Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,11 @@ protected String insertCaptureGroups(String replaceMessage) {
Matcher m = matcher.get();
m.reset();
if (!m.find()) return replaceMessage; // shouldn't happen but you never know
m.appendReplacement(sb, replaceMessage);
try {
m.appendReplacement(sb, replaceMessage);
} catch (IndexOutOfBoundsException | IllegalArgumentException _) {
return replaceMessage;
}
return sb.substring(m.start());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public RangedSliderWidget(int x, int y, int width, int height, double defaultVal
this.step = step;
this.formatter = formatter;
this.callback = callback;
setValue(defaultValue);
setValue(valueToProgress(defaultValue));
}

private double roundToNearestStep(double value) {
Expand All @@ -45,11 +45,6 @@ protected void updateMessage() {
setMessage(this.formatter.apply(getValue()));
}

public void setValue(double value) {
this.value = valueToProgress(value);
this.updateMessage();
}

public double getValue() {
return roundToNearestStep(progressToValue(this.value));
}
Expand Down
Loading