diff --git a/src/main/java/eu/hansolo/medusa/Test.java b/src/main/java/eu/hansolo/medusa/Test.java index 82285ec8..04cfc8ef 100644 --- a/src/main/java/eu/hansolo/medusa/Test.java +++ b/src/main/java/eu/hansolo/medusa/Test.java @@ -81,13 +81,15 @@ public class Test extends Application { .build(); gauge = GaugeBuilder.create() - .skinType(SkinType.MODERN) + .skinType(SkinType.HORIZONTAL) //.prefSize(400, 400) .knobPosition(Pos.BOTTOM_LEFT) .tickLabelLocation(TickLabelLocation.OUTSIDE) + .tickMarkRingVisible(true) + .scaleDirection(Gauge.ScaleDirection.COUNTER_CLOCKWISE) .decimals(2) .minValue(-20) - .maxValue(120) + .maxValue(100) .startFromZero(true) .animated(true) //.checkThreshold(true) diff --git a/src/main/java/eu/hansolo/medusa/skins/QuarterSkin.java b/src/main/java/eu/hansolo/medusa/skins/QuarterSkin.java index 2d6cf851..98a82c14 100644 --- a/src/main/java/eu/hansolo/medusa/skins/QuarterSkin.java +++ b/src/main/java/eu/hansolo/medusa/skins/QuarterSkin.java @@ -576,10 +576,10 @@ private void drawTickMarks() { tickMarkCtx.save(); tickMarkCtx.setStroke(tickMarkColor); switch(knobPosition) { - case BOTTOM_LEFT: tickMarkCtx.strokeArc((-scaledSize * 0.46) + xy, xy, wh, wh, offset, -ANGLE_RANGE, ArcType.OPEN); break; - case TOP_LEFT : tickMarkCtx.strokeArc((-scaledSize * 0.46) + xy, (-scaledSize * 0.46) + xy, wh, wh, offset, -ANGLE_RANGE, ArcType.OPEN); break; - case TOP_RIGHT : tickMarkCtx.strokeArc(xy, (-scaledSize * 0.46) + xy, wh, wh, offset, -ANGLE_RANGE, ArcType.OPEN); break; - default : tickMarkCtx.strokeArc(xy, xy, wh, wh, offset, -ANGLE_RANGE, ArcType.OPEN); break; + case BOTTOM_LEFT: tickMarkCtx.strokeArc((-scaledSize * 0.46) + xy, xy, wh, wh, offset, ScaleDirection.CLOCKWISE == scaleDirection ? -ANGLE_RANGE : ANGLE_RANGE, ArcType.OPEN); break; + case TOP_LEFT : tickMarkCtx.strokeArc((-scaledSize * 0.46) + xy, (-scaledSize * 0.46) + xy, wh, wh, offset, ScaleDirection.CLOCKWISE == scaleDirection ? -ANGLE_RANGE : ANGLE_RANGE, ArcType.OPEN); break; + case TOP_RIGHT : tickMarkCtx.strokeArc(xy, (-scaledSize * 0.46) + xy, wh, wh, offset, ScaleDirection.CLOCKWISE == scaleDirection ? -ANGLE_RANGE : ANGLE_RANGE, ArcType.OPEN); break; + default : tickMarkCtx.strokeArc(xy, xy, wh, wh, offset, ScaleDirection.CLOCKWISE == scaleDirection ? -ANGLE_RANGE : ANGLE_RANGE, ArcType.OPEN); break; } tickMarkCtx.restore(); if (tickMarkSections.size() > 0) { diff --git a/src/main/java/eu/hansolo/medusa/tools/Helper.java b/src/main/java/eu/hansolo/medusa/tools/Helper.java index f7df675a..7adf40cc 100644 --- a/src/main/java/eu/hansolo/medusa/tools/Helper.java +++ b/src/main/java/eu/hansolo/medusa/tools/Helper.java @@ -508,9 +508,9 @@ public static void drawRadialTickMarks(final Gauge GAUGE, final GraphicsContext CTX.save(); CTX.setStroke(tickMarkColor); switch(skinType) { - case HORIZONTAL: CTX.strokeArc(xy + horVerOffset, xy, wh, wh, offset, -ANGLE_RANGE, ArcType.OPEN); break; - case VERTICAL : CTX.strokeArc(xy, xy + horVerOffset, wh, wh, offset, -ANGLE_RANGE, ArcType.OPEN); break; - default : CTX.strokeArc(xy, xy, wh, wh, offset, -ANGLE_RANGE, ArcType.OPEN); break; + case HORIZONTAL: CTX.strokeArc(xy + horVerOffset, xy, wh, wh, offset, ScaleDirection.CLOCKWISE == scaleDirection ? -ANGLE_RANGE : ANGLE_RANGE, ArcType.OPEN); break; + case VERTICAL : CTX.strokeArc(xy, xy + horVerOffset, wh, wh, offset, ScaleDirection.CLOCKWISE == scaleDirection ? -ANGLE_RANGE : ANGLE_RANGE, ArcType.OPEN); break; + default : CTX.strokeArc(xy, xy, wh, wh, offset, ScaleDirection.CLOCKWISE == scaleDirection ? -ANGLE_RANGE : ANGLE_RANGE, ArcType.OPEN); break; } CTX.restore();