initial commit
This commit is contained in:
22
source/Marks/DoubleLineMark.mc
Normal file
22
source/Marks/DoubleLineMark.mc
Normal file
@ -0,0 +1,22 @@
|
||||
import Toybox.Graphics;
|
||||
import Toybox.Lang;
|
||||
import Toybox.WatchUi;
|
||||
|
||||
class DoubleLineMark extends IMark {
|
||||
|
||||
var Offset as Float = Math.toRadians(1.0);
|
||||
|
||||
function initialize(options as IMark.MarkParams) {
|
||||
IMark.initialize(options);
|
||||
}
|
||||
|
||||
function drawMark(dc as Dc, x as Float, y as Float, length as Float) as Void {
|
||||
var angle = getAngle();
|
||||
|
||||
dc.setColor(Color, Color);
|
||||
dc.drawLine(x + length * InnerRadius * Math.cos(angle - Offset), y + length * InnerRadius * Math.sin(angle - Offset),
|
||||
x + length * Radius * Math.cos(angle - Offset), y + length * Radius * Math.sin(angle - Offset));
|
||||
dc.drawLine(x + length * InnerRadius * Math.cos(angle + Offset), y + length * InnerRadius * Math.sin(angle + Offset),
|
||||
x + length * Radius * Math.cos(angle + Offset), y + length * Radius * Math.sin(angle + Offset));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user