mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/virt-viewer
synced 2025-12-30 18:31:52 +00:00
virt-viewer-window: Make sure that minimum zoom level is lower than NORMAL_ZOOM_LEVEL
The minimum size of the desktop is 100x100 if the minimum window size is greater than this, the zoom level is greater than NORMAL_ZOOM_LEVEL related: rhbz#1206460
This commit is contained in:
parent
82d6280e5c
commit
41645a0eb5
@ -1576,7 +1576,8 @@ virt_viewer_window_get_minimal_zoom_level(VirtViewerWindow *self)
|
||||
height_ratio = (double) min_height / height;
|
||||
zoom = ceil(10 * MAX(width_ratio, height_ratio));
|
||||
|
||||
return MAX(MIN_ZOOM_LEVEL, zoom * ZOOM_STEP);
|
||||
/* make sure that the returned zoom level is in the range from MIN_ZOOM_LEVEL to NORMAL_ZOOM_LEVEL */
|
||||
return CLAMP(zoom * ZOOM_STEP, MIN_ZOOM_LEVEL, NORMAL_ZOOM_LEVEL);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Loading…
Reference in New Issue
Block a user