UI: Fix clipping with margins.

Affected text views, like "No screenshot." in save states.
This commit is contained in:
Unknown W. Brackets 2016-01-23 11:45:55 -08:00
parent 21a15e4728
commit 8d41664bb1
2 changed files with 3 additions and 4 deletions

View File

@ -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()) {

View File

@ -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;