From 23a6f57067784d77f77e9416111f89d985b9d94a Mon Sep 17 00:00:00 2001 From: Simon Judd Date: Sun, 17 Dec 2023 18:28:25 +1030 Subject: [PATCH] Fix gfx drag preview not snapping to pixels --- src/UI/Canvas/GfxCanvas.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/UI/Canvas/GfxCanvas.cpp b/src/UI/Canvas/GfxCanvas.cpp index a0d88cf17..693f0bd4e 100644 --- a/src/UI/Canvas/GfxCanvas.cpp +++ b/src/UI/Canvas/GfxCanvas.cpp @@ -37,8 +37,8 @@ #include "Graphics/Translation.h" #include "OpenGL/Drawing.h" #include "OpenGL/GLTexture.h" -#include "UI/SBrush.h" #include "UI/Controls/ZoomControl.h" +#include "UI/SBrush.h" #include "Utility/MathStuff.h" using namespace slade; @@ -255,8 +255,8 @@ void GfxCanvas::drawImage() drawing::drawTexture(tex_image_); // Draw the dragged image - const auto off_x = static_cast(drag_pos_.x - drag_origin_.x) / scale_; - const auto off_y = static_cast(drag_pos_.y - drag_origin_.y) / scale_; + const auto off_x = static_cast((drag_pos_.x - drag_origin_.x) / scale_); + const auto off_y = static_cast((drag_pos_.y - drag_origin_.y) / scale_); glTranslated(off_x, off_y, 0); gl::setColour(255, 255, 255, 255, gl::Blend::Normal); drawing::drawTexture(tex_image_);