|
|
|
@ -51,22 +51,8 @@ static bool view_at(struct roots_view *view, double lx, double ly,
|
|
|
|
|
|
|
|
|
|
double view_sx = lx - view->box.x;
|
|
|
|
|
double view_sy = ly - view->box.y;
|
|
|
|
|
|
|
|
|
|
struct wlr_surface_state *state = &view->wlr_surface->current;
|
|
|
|
|
struct wlr_box box = {
|
|
|
|
|
.x = 0, .y = 0,
|
|
|
|
|
.width = state->width, .height = state->height,
|
|
|
|
|
};
|
|
|
|
|
if (view->rotation != 0.0) {
|
|
|
|
|
// Coordinates relative to the center of the view
|
|
|
|
|
double ox = view_sx - (double)box.width/2,
|
|
|
|
|
oy = view_sy - (double)box.height/2;
|
|
|
|
|
// Rotated coordinates
|
|
|
|
|
double rx = cos(view->rotation)*ox + sin(view->rotation)*oy,
|
|
|
|
|
ry = cos(view->rotation)*oy - sin(view->rotation)*ox;
|
|
|
|
|
view_sx = rx + (double)box.width/2;
|
|
|
|
|
view_sy = ry + (double)box.height/2;
|
|
|
|
|
}
|
|
|
|
|
rotate_child_position(&view_sx, &view_sy, 0, 0,
|
|
|
|
|
view->box.width, view->box.height, -view->rotation);
|
|
|
|
|
|
|
|
|
|
double _sx, _sy;
|
|
|
|
|
struct wlr_surface *_surface = NULL;
|
|
|
|
|