From 40caabea238ef435b097fd7885b2fe7b4efe03cf Mon Sep 17 00:00:00 2001 From: Ryan Heuer <63077980+rmheuer@users.noreply.github.com> Date: Wed, 16 Oct 2024 00:02:08 -0500 Subject: [PATCH] [glass] Align Field2d border and image padding (#7214) --- glass/src/lib/native/cpp/other/Field2D.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/glass/src/lib/native/cpp/other/Field2D.cpp b/glass/src/lib/native/cpp/other/Field2D.cpp index 505a9d6055..10019c620e 100644 --- a/glass/src/lib/native/cpp/other/Field2D.cpp +++ b/glass/src/lib/native/cpp/other/Field2D.cpp @@ -591,6 +591,12 @@ FieldFrameData FieldInfo::GetFrameData(ImVec2 min, ImVec2 max) const { max.x -= 20; min.y += 20; max.y -= 20; + + // also pad the image so it's the same size as the box + ffd.imageMin.x += 20; + ffd.imageMax.x -= 20; + ffd.imageMin.y += 20; + ffd.imageMax.y -= 20; } ffd.min = min;