fix: remove superfluous ceil() calls for picking coordinates

This commit is contained in:
Nick Fisher
2024-10-31 15:30:49 +08:00
parent c40faeb888
commit e22a0aec4d

View File

@@ -1514,7 +1514,7 @@ class ThermionViewerFFI extends ThermionViewer {
final viewport = await view.getViewport();
_pickResultController
.add((entity: entityId, x: x.ceil(), y: (viewport.height - y).ceil(), depth: depth, fragX: fragX, fragY: viewport.height - fragY, fragZ: fragZ ));
.add((entity: entityId, x: x, y: (viewport.height - y), depth: depth, fragX: fragX, fragY: viewport.height - fragY, fragZ: fragZ ));
}
late NativeCallable<
@@ -1528,7 +1528,7 @@ class ThermionViewerFFI extends ThermionViewer {
Future pick(int x, int y) async {
final view = (await getViewAt(0)) as FFIView;
var viewport = await view.getViewport();
y = (viewport.height - y).ceil();
y = viewport.height - y;
Viewer_pick(
_viewer!, view.view, x, y, _onPickResultCallable.nativeFunction);
}