fix shrinking sliders on sliders with odd amount of repeats when using fallback rendering (close #108)

This commit is contained in:
yugecin 2016-12-13 15:44:33 +01:00
parent d9669ddcd5
commit d7d28a559b

View File

@ -434,17 +434,15 @@ public class Slider extends GameObject {
} }
game.setSlidercurveTo(baseSliderFrom + (int) (curveIntervalTo * curve.getCurvePoints().length)); game.setSlidercurveTo(baseSliderFrom + (int) (curveIntervalTo * curve.getCurvePoints().length));
} else { } else {
if (Options.isFallbackSliders() && curveIntervalFrom > 0 && repeats % 2 == 0) { if (Options.isShrinkingSliders() && curveIntervalFrom > 0 && repeats % 2 == 0) {
curve.draw(curveColor, (int) (curveIntervalFrom * curvelen), (int) (curveIntervalTo * curvelen)); if (Options.isFallbackSliders()) {
} else { curveIntervalTo = 1d - curveIntervalFrom;
if (Options.isShrinkingSliders() && curveIntervalFrom > 0 && !Options.isFallbackSliders()) { } else {
if (repeats % 2 == 0) { curve.splice((int) ((1d - curveIntervalFrom) * curvelen), curvelen);
curve.splice((int) ((1d - curveIntervalFrom) * curvelen), curvelen);
curveIntervalFrom = 0d;
}
} }
curve.draw(curveColor, (int) (curveIntervalFrom * curvelen), (int) (curveIntervalTo * curvelen)); curveIntervalFrom = 0d;
} }
curve.draw(curveColor, (int) (curveIntervalFrom * curvelen), (int) (curveIntervalTo * curvelen));
} }
return curveIntervalTo == 1d; return curveIntervalTo == 1d;
} }