From 8d41664bb10257772ce1c33e65af98bc043e40d8 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 23 Jan 2016 11:45:55 -0800 Subject: [PATCH] UI: Fix clipping with margins. Affected text views, like "No screenshot." in save states. --- ext/native/ui/view.cpp | 3 +-- ext/native/ui/viewgroup.cpp | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/ext/native/ui/view.cpp b/ext/native/ui/view.cpp index 32ba78ae7f..7014e4b363 100644 --- a/ext/native/ui/view.cpp +++ b/ext/native/ui/view.cpp @@ -658,9 +658,8 @@ void TextView::Draw(UIContext &dc) { clip = false; } if (clip) { - Bounds clipRect = bounds_.Expand(10); // TODO: Remove this hackery dc.Flush(); - dc.PushScissor(clipRect); + dc.PushScissor(bounds_); } // In case it's been made focusable. if (HasFocus()) { diff --git a/ext/native/ui/viewgroup.cpp b/ext/native/ui/viewgroup.cpp index 79f67a06fc..11eee82f93 100644 --- a/ext/native/ui/viewgroup.cpp +++ b/ext/native/ui/viewgroup.cpp @@ -35,8 +35,8 @@ bool IsDragCaptured(int id) { } void ApplyGravity(const Bounds outer, const Margins &margins, float w, float h, int gravity, Bounds &inner) { - inner.w = w - (margins.left + margins.right); - inner.h = h - (margins.top + margins.bottom); + inner.w = w; + inner.h = h; switch (gravity & G_HORIZMASK) { case G_LEFT: inner.x = outer.x + margins.left; break;