Make positions integers
This commit is contained in:
parent
a2cd2f596a
commit
7883089834
4 changed files with 10 additions and 10 deletions
|
@ -49,8 +49,8 @@ struct kiwmi_view {
|
||||||
struct wl_listener request_move;
|
struct wl_listener request_move;
|
||||||
struct wl_listener request_resize;
|
struct wl_listener request_resize;
|
||||||
|
|
||||||
double x;
|
int x;
|
||||||
double y;
|
int y;
|
||||||
|
|
||||||
bool mapped;
|
bool mapped;
|
||||||
bool hidden;
|
bool hidden;
|
||||||
|
|
|
@ -39,8 +39,8 @@ render_layer_surface(struct wlr_surface *surface, int x, int y, void *data)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
double ox = rdata->output_lx + x + geom->x;
|
int ox = rdata->output_lx + x + geom->x;
|
||||||
double oy = rdata->output_ly + y + geom->y;
|
int oy = rdata->output_ly + y + geom->y;
|
||||||
|
|
||||||
struct wlr_box box = {
|
struct wlr_box box = {
|
||||||
.x = ox * output->scale,
|
.x = ox * output->scale,
|
||||||
|
@ -84,8 +84,8 @@ render_surface(struct wlr_surface *surface, int sx, int sy, void *data)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
double ox = rdata->output_lx + sx + view->x - view->geom.x;
|
int ox = rdata->output_lx + sx + view->x - view->geom.x;
|
||||||
double oy = rdata->output_ly + sy + view->y - view->geom.y;
|
int oy = rdata->output_ly + sy + view->y - view->geom.y;
|
||||||
|
|
||||||
struct wlr_box box = {
|
struct wlr_box box = {
|
||||||
.x = ox * output->scale,
|
.x = ox * output->scale,
|
||||||
|
|
|
@ -42,8 +42,8 @@ process_cursor_motion(struct kiwmi_server *server, uint32_t time)
|
||||||
}
|
}
|
||||||
case KIWMI_CURSOR_RESIZE: {
|
case KIWMI_CURSOR_RESIZE: {
|
||||||
struct kiwmi_view *view = cursor->grabbed.view;
|
struct kiwmi_view *view = cursor->grabbed.view;
|
||||||
double dx = cursor->cursor->x - cursor->grabbed.orig_x;
|
int dx = cursor->cursor->x - cursor->grabbed.orig_x;
|
||||||
double dy = cursor->cursor->y - cursor->grabbed.orig_y;
|
int dy = cursor->cursor->y - cursor->grabbed.orig_y;
|
||||||
|
|
||||||
struct wlr_box new_geom = {
|
struct wlr_box new_geom = {
|
||||||
.x = view->x,
|
.x = view->x,
|
||||||
|
|
|
@ -191,8 +191,8 @@ l_kiwmi_view_pos(lua_State *L)
|
||||||
struct kiwmi_view *view =
|
struct kiwmi_view *view =
|
||||||
*(struct kiwmi_view **)luaL_checkudata(L, 1, "kiwmi_view");
|
*(struct kiwmi_view **)luaL_checkudata(L, 1, "kiwmi_view");
|
||||||
|
|
||||||
lua_pushnumber(L, view->x);
|
lua_pushinteger(L, view->x);
|
||||||
lua_pushnumber(L, view->y);
|
lua_pushinteger(L, view->y);
|
||||||
|
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue