Skip to content

Commit ed5b95f

Browse files
committed
Define zoom as a percentage, fix typo
1 parent 2794700 commit ed5b95f

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

app/display/runtime/src/main/java/org/csstudio/display/builder/runtime/app/ZoomAction.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public class ZoomAction extends ComboBox<String>
2222
{
2323
private boolean updating = false;
2424

25-
@Preference public static double default_zoom_factor;
25+
@Preference public static int default_zoom_factor;
2626

2727
static
2828
{
@@ -35,6 +35,7 @@ public ZoomAction(final DisplayRuntimeInstance instance)
3535
setEditable(true);
3636
setPrefWidth(100.0);
3737
getItems().addAll(JFXRepresentation.ZOOM_LEVELS);
38+
setValue(JFXRepresentation.DEFAULT_ZOOM_LEVEL);
3839
// For Ctrl-Wheel zoom gesture
3940
instance.getRepresentation().setZoomListener(txt ->
4041
{
@@ -43,10 +44,10 @@ public ZoomAction(final DisplayRuntimeInstance instance)
4344
});
4445
setOnAction(event -> zoom(instance.getRepresentation()));
4546

46-
// Add the zoom action into a queue
47+
// Apply default zoom factor from settings.ini
4748
Platform.runLater(() ->
4849
{
49-
String zoom = String.format("%d %%", (int)(default_zoom_factor * 100));
50+
String zoom = String.format("%d %%", default_zoom_factor);
5051
setValue(zoom);
5152
});
5253
}

app/display/runtime/src/main/resources/zoom_preferences.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
# Package org.csstudio.display.builder.runtime.app
33
# ----------------------
44

5-
# Defualt zoom factor(double) of display runtime window
6-
default_zoom_factor=1.00
5+
# Default zoom factor (percentage) of display runtime window
6+
default_zoom_factor=100

0 commit comments

Comments
 (0)