2323import javafx .scene .input .MouseButton ;
2424import javafx .scene .input .ZoomEvent ;
2525import javafx .scene .layout .*;
26+ import javafx .scene .layout .StackPane ;
2627import javafx .geometry .Orientation ;
2728import javafx .scene .paint .Color ;
2829import javafx .scene .text .Font ;
@@ -199,31 +200,39 @@ private ToolBar createActionBar() {
199200 this .zoomSlider = zoomSlider ;
200201
201202 // Create modern zoom buttons with FontAwesome icons and orange theme
202- btnZoomOut = new Button ();
203- FontAwesomeIconView zoomOutIcon = new FontAwesomeIconView (FontAwesomeIcon .MINUS );
204- zoomOutIcon .setGlyphSize (14 );
205- zoomOutIcon .getStyleClass ().addAll ("fdd-action-icon" , "fdd-icon" );
206- btnZoomOut .setGraphic (zoomOutIcon );
203+ btnZoomOut = new Button ();
204+ FontAwesomeIconView zoomOutIcon = new FontAwesomeIconView (FontAwesomeIcon .MINUS );
205+ zoomOutIcon .setSmooth (false ); // disable text smoothing for crisper small glyph
206+ zoomOutIcon .setGlyphSize (16 ); // Option B: even glyph size for sharper pixel alignment
207+ zoomOutIcon .getStyleClass ().addAll ("fdd-action-icon" , "fdd-icon" );
208+ StackPane zoomOutWrap = new StackPane (zoomOutIcon ); // Option A: snap to pixel wrapper
209+ zoomOutWrap .setSnapToPixel (true );
210+ btnZoomOut .setGraphic (zoomOutWrap );
207211 btnZoomOut .setMinWidth (32 );
208212 btnZoomOut .setPrefWidth (32 );
209213 btnZoomOut .setMinHeight (28 );
210214 btnZoomOut .setPrefHeight (28 );
211215 btnZoomOut .setOnAction (e -> zoomOut ());
212216 btnZoomOut .setTooltip (new Tooltip ("Zoom Out (Ctrl + Mouse Wheel or ⌘−)" ));
213- btnZoomOut .getStyleClass ().addAll ("fdd-action-button" , "fdd-icon-button" , "zoom-button" , "zoom-out-button" );
214-
215- btnZoomIn = new Button ();
216- FontAwesomeIconView zoomInIcon = new FontAwesomeIconView (FontAwesomeIcon .PLUS );
217- zoomInIcon .setGlyphSize (14 );
218- zoomInIcon .getStyleClass ().addAll ("fdd-action-icon" , "fdd-icon" );
219- btnZoomIn .setGraphic (zoomInIcon );
217+ btnZoomOut .getStyleClass ().addAll ("fdd-action-button" , "fdd-icon-button" );
218+ btnZoomOut .setSnapToPixel (true ); // ensure crisp rendering when armed
219+
220+ btnZoomIn = new Button ();
221+ FontAwesomeIconView zoomInIcon = new FontAwesomeIconView (FontAwesomeIcon .PLUS );
222+ zoomInIcon .setSmooth (false ); // disable smoothing for crisp edges
223+ zoomInIcon .setGlyphSize (16 ); // Option B: even glyph size
224+ zoomInIcon .getStyleClass ().addAll ("fdd-action-icon" , "fdd-icon" );
225+ StackPane zoomInWrap = new StackPane (zoomInIcon ); // Option A wrapper
226+ zoomInWrap .setSnapToPixel (true );
227+ btnZoomIn .setGraphic (zoomInWrap );
220228 btnZoomIn .setMinWidth (32 );
221229 btnZoomIn .setPrefWidth (32 );
222230 btnZoomIn .setMinHeight (28 );
223231 btnZoomIn .setPrefHeight (28 );
224232 btnZoomIn .setOnAction (e -> zoomIn ());
225233 btnZoomIn .setTooltip (new Tooltip ("Zoom In (Ctrl + Mouse Wheel or ⌘+)" ));
226- btnZoomIn .getStyleClass ().addAll ("fdd-action-button" , "fdd-icon-button" , "zoom-button" , "zoom-in-button" );
234+ btnZoomIn .getStyleClass ().addAll ("fdd-action-button" , "fdd-icon-button" );
235+ btnZoomIn .setSnapToPixel (true ); // ensure crisp rendering when armed
227236
228237 // Modern control buttons with better icons/text
229238 btnReset = new Button ("100%" );
@@ -233,7 +242,8 @@ private ToolBar createActionBar() {
233242 btnReset .setPrefHeight (28 );
234243 btnReset .setOnAction (e -> resetZoom ());
235244 btnReset .setTooltip (new Tooltip ("Reset to 100% (⌘0)" ));
236- btnReset .getStyleClass ().addAll ("zoom-button" , "reset-button" );
245+ // Make reset visually consistent: treat as icon/button variant with same border/hover
246+ btnReset .getStyleClass ().addAll ("fdd-action-button" , "fdd-icon-button" , "reset-button" );
237247
238248 btnFit = new Button ();
239249 FontAwesomeIconView fitIcon = new FontAwesomeIconView (FontAwesomeIcon .ARROWS_ALT );
@@ -246,7 +256,7 @@ private ToolBar createActionBar() {
246256 btnFit .setPrefHeight (28 );
247257 btnFit .setOnAction (e -> fitToWindow ());
248258 btnFit .setTooltip (new Tooltip ("Fit to Window" ));
249- btnFit .getStyleClass ().addAll ("fdd-action-button" , "fdd-icon-button" , "zoom -button" , "fit-button" );
259+ btnFit .getStyleClass ().addAll ("fdd-action-button" , "fdd-icon-button" , "fit-button" );
250260
251261 // Group zoom buttons in a contained group
252262 HBox zoomButtons = new HBox (2 );
@@ -282,7 +292,7 @@ private ToolBar createActionBar() {
282292 saveButton .setPrefHeight (32 );
283293 saveButton .setOnAction (e -> saveImage ());
284294 saveButton .setTooltip (new Tooltip ("Save as Image (⌘S)" ));
285- saveButton .getStyleClass ().addAll ("fdd-action-button" , "fdd-icon-button" , "action -button" , "save-button" );
295+ saveButton .getStyleClass ().addAll ("fdd-action-button" , "fdd-icon-button" , "save-button" );
286296
287297 printButton = new Button ();
288298 FontAwesomeIconView printIcon = new FontAwesomeIconView (FontAwesomeIcon .PRINT );
@@ -296,7 +306,7 @@ private ToolBar createActionBar() {
296306 printButton .setPrefHeight (32 );
297307 printButton .setOnAction (e -> printImage ());
298308 printButton .setTooltip (new Tooltip ("Print (⌘P)" ));
299- printButton .getStyleClass ().addAll ("fdd-action-button" , "fdd-icon-button" , "action -button" , "print-button" );
309+ printButton .getStyleClass ().addAll ("fdd-action-button" , "fdd-icon-button" , "print-button" );
300310
301311 // Create spacer to push action buttons to the right
302312 Region spacer = new Region ();
0 commit comments