Make positions integers

This commit is contained in:
buffet 2020-01-26 19:28:00 +00:00
parent a2cd2f596a
commit 7883089834
4 changed files with 10 additions and 10 deletions

View file

@ -49,8 +49,8 @@ struct kiwmi_view {
struct wl_listener request_move;
struct wl_listener request_resize;
double x;
double y;
int x;
int y;
bool mapped;
bool hidden;

View file

@ -39,8 +39,8 @@ render_layer_surface(struct wlr_surface *surface, int x, int y, void *data)
return;
}
double ox = rdata->output_lx + x + geom->x;
double oy = rdata->output_ly + y + geom->y;
int ox = rdata->output_lx + x + geom->x;
int oy = rdata->output_ly + y + geom->y;
struct wlr_box box = {
.x = ox * output->scale,
@ -84,8 +84,8 @@ render_surface(struct wlr_surface *surface, int sx, int sy, void *data)
return;
}
double ox = rdata->output_lx + sx + view->x - view->geom.x;
double oy = rdata->output_ly + sy + view->y - view->geom.y;
int ox = rdata->output_lx + sx + view->x - view->geom.x;
int oy = rdata->output_ly + sy + view->y - view->geom.y;
struct wlr_box box = {
.x = ox * output->scale,

View file

@ -42,8 +42,8 @@ process_cursor_motion(struct kiwmi_server *server, uint32_t time)
}
case KIWMI_CURSOR_RESIZE: {
struct kiwmi_view *view = cursor->grabbed.view;
double dx = cursor->cursor->x - cursor->grabbed.orig_x;
double dy = cursor->cursor->y - cursor->grabbed.orig_y;
int dx = cursor->cursor->x - cursor->grabbed.orig_x;
int dy = cursor->cursor->y - cursor->grabbed.orig_y;
struct wlr_box new_geom = {
.x = view->x,

View file

@ -191,8 +191,8 @@ l_kiwmi_view_pos(lua_State *L)
struct kiwmi_view *view =
*(struct kiwmi_view **)luaL_checkudata(L, 1, "kiwmi_view");
lua_pushnumber(L, view->x);
lua_pushnumber(L, view->y);
lua_pushinteger(L, view->x);
lua_pushinteger(L, view->y);
return 2;
}