From d3a7807307537813b6470b17cf85a20e93f3cf09 Mon Sep 17 00:00:00 2001 From: Punio85 Date: Wed, 4 Jun 2025 14:17:07 +0200 Subject: [PATCH] Update grid_place_meeting.gml floor and ceil -> Prevents jitter caused by subpixel movement. --- scripts/grid_place_meeting/grid_place_meeting.gml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/grid_place_meeting/grid_place_meeting.gml b/scripts/grid_place_meeting/grid_place_meeting.gml index 3ad6668..e9c9f49 100644 --- a/scripts/grid_place_meeting/grid_place_meeting.gml +++ b/scripts/grid_place_meeting/grid_place_meeting.gml @@ -3,10 +3,10 @@ var _object = argument0; var _grid = argument1; -var _top_right = _grid[# (_object.bbox_right-1) div CELL_WIDTH, _object.bbox_top div CELL_HEIGHT] == VOID; -var _top_left = _grid[# _object.bbox_left div CELL_WIDTH, _object.bbox_top div CELL_HEIGHT] == VOID; -var _bottom_right = _grid[# (_object.bbox_right-1) div CELL_WIDTH, (_object.bbox_bottom-1) div CELL_HEIGHT] == VOID; -var _bottom_left = _grid[# _object.bbox_left div CELL_WIDTH, (_object.bbox_bottom-1) div CELL_HEIGHT] == VOID; +var _top_right = _grid[# (ceil(_object.bbox_right)-1) div CELL_WIDTH, floor(_object.bbox_top) div CELL_HEIGHT] == VOID; +var _top_left = _grid[# floor(_object.bbox_left) div CELL_WIDTH, floor(_object.bbox_top) div CELL_HEIGHT] == VOID; +var _bottom_right = _grid[# (ceil(_object.bbox_right)-1) div CELL_WIDTH, (ceil(_object.bbox_bottom)-1) div CELL_HEIGHT] == VOID; +var _bottom_left = _grid[# floor(_object.bbox_left) div CELL_WIDTH, (ceil(_object.bbox_bottom)-1) div CELL_HEIGHT] == VOID; -return _top_right || _top_left || _bottom_right || _bottom_left; \ No newline at end of file +return _top_right || _top_left || _bottom_right || _bottom_left;