Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Resize zoom list if a new output was added

  • Loading branch information...
commit 7b01578cf1c954755ce18fc7e75033aef8cbeb29 1 parent 5cf8515
Sam Spilsbury smspillaz authored
Showing with 20 additions and 3 deletions.
  1. +20 −3 src/ezoom.cpp
23 src/ezoom.cpp
View
@@ -97,8 +97,10 @@ outputIsZoomArea (int out)
{
ZOOM_SCREEN (screen);
- if (out < 0 || (unsigned int) out >= zs->zooms.size ())
+ if (out < 0)
return false;
+ else if ((unsigned int) out >= zs->zooms.size ())
+ zs->zooms.resize (screen->outputDevs ().size ());
return true;
}
@@ -783,7 +785,15 @@ EZoomScreen::convertToZoomed (int out,
int *resultX,
int *resultY)
{
- CompOutput *o = &screen->outputDevs ()[out];
+ CompOutput *o;
+
+ if (!outputIsZoomArea (out))
+ {
+ *resultX = x;
+ *resultY = y;
+ }
+
+ o = &screen->outputDevs ()[out];
ZoomArea &za = zooms.at (out);
x -= o->x1 ();
@@ -808,7 +818,14 @@ EZoomScreen::convertToZoomedTarget (int out,
int *resultX,
int *resultY)
{
- CompOutput *o = &screen->outputDevs ().at (out);
+ CompOutput *o;
+
+ if (!outputIsZoomArea (out))
+ {
+ *resultX = x;
+ *resultY = y;
+ }
+
ZoomArea &za = zooms.at (out);
x -= o->x1 ();
Please sign in to comment.
Something went wrong with that request. Please try again.