pub enum ScaleMode {
Stretch,
AspectRatioStretch,
Center,
UpperLeft,
}
Expand description
On some OS (X11 for example) it’s possible a window can resize even if no resize has been set. This causes some issues depending on how the content of an input buffer should be displayed then it’s possible to set this scaling mode to get a better behavior.
Variants§
Stretch
Stretch the buffer in the whole window meaning if your buffer is 256x256 and window is 1024x1024 it will be scaled up 4 times
AspectRatioStretch
Keep the correct aspect ratio to be displayed while scaling up fully in the other axis. Fill area will be filed with Window::set_bg_color (default 0, 0, 0)
Center
Places the buffer in the middle of the window without any scaling. Fills the borders with color set Window::set_background_color
(default 0, 0, 0)
If the window is smaller than the buffer the center of the buffer will be displayed
UpperLeft
Same as Center but places the buffer in the upper left corner of the window.