rootston: fix rotated subsurfaces

This commit is contained in:
emersion 2017-10-04 23:05:57 +02:00
parent 3b226ba81a
commit 1a775adbde
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48
2 changed files with 19 additions and 4 deletions

View file

@ -102,8 +102,8 @@ struct roots_view *view_at(struct roots_desktop *desktop, double lx, double ly,
// Rotated coordinates
double rx = cos(view->rotation)*ox - sin(view->rotation)*oy,
ry = cos(view->rotation)*oy + sin(view->rotation)*ox;
view_sx = (double)box.width/2 + rx;
view_sy = (double)box.height/2 + ry;
view_sx = rx + (double)box.width/2;
view_sy = ry + (double)box.height/2;
}
double sub_x, sub_y;