mirror of
https://github.com/labwc/labwc.git
synced 2026-04-12 08:21:13 -04:00
Now with the right calculation...
This commit is contained in:
parent
035e2b7fc9
commit
94afd1f7b0
1 changed files with 15 additions and 2 deletions
|
|
@ -44,6 +44,17 @@ lab_wlr_scene_get_prev_node(struct wlr_scene_node *node)
|
|||
return prev;
|
||||
}
|
||||
|
||||
static double constrain (double lower, double in, double upper)
|
||||
{
|
||||
if (in < lower) {
|
||||
return lower;
|
||||
}
|
||||
if (in > upper) {
|
||||
return upper;
|
||||
}
|
||||
return in;
|
||||
}
|
||||
|
||||
static void
|
||||
magnify(struct output *output, struct wlr_buffer *output_buffer, struct wlr_box *damage)
|
||||
{
|
||||
|
|
@ -211,8 +222,10 @@ magnify(struct output *output, struct wlr_buffer *output_buffer, struct wlr_box
|
|||
dst_box.height = height;
|
||||
|
||||
if (theme->mag_fullscreen) {
|
||||
src_box.x = MAX(0, MIN(ox - width / (2 * mag_scale), width * (mag_scale - 1) / mag_scale));
|
||||
src_box.y = MAX(0, MIN(oy - height / (2 * mag_scale), height * (mag_scale - 1) / mag_scale));
|
||||
src_box.x = constrain (0.0, ox - (ox / mag_scale),
|
||||
width * (mag_scale - 1.0) / mag_scale);
|
||||
src_box.y = constrain (0.0, oy - (oy / mag_scale),
|
||||
height * (mag_scale - 1.0) / mag_scale);
|
||||
dst_box.x = 0;
|
||||
dst_box.y = 0;
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue