From 97491fd0a01a6ae81174e555ecd043f3adf8554c Mon Sep 17 00:00:00 2001 From: cxl Date: Wed, 14 Oct 2020 09:34:52 +0000 Subject: [PATCH] CtrlLib: Fixed Switch layout issue git-svn-id: svn://ultimatepp.org/upp/trunk@15245 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/CtrlLib/CtrlLib.usc | 2 +- uppsrc/CtrlLib/Switch.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/uppsrc/CtrlLib/CtrlLib.usc b/uppsrc/CtrlLib/CtrlLib.usc index e5f742fbb..1ca9ce458 100644 --- a/uppsrc/CtrlLib/CtrlLib.usc +++ b/uppsrc/CtrlLib/CtrlLib.usc @@ -691,7 +691,7 @@ ctrl Switch { DrawOption(w, x, (sz.cy - osz) / 2, 2); w.DrawSmartText(x + osz + 4, (sz.cy - tcy) / 2, cs[i], .SetFont); } - x += osz + 4 + textsize.cx + max(osz, tcy) / 2; + x += osz + 4 + textsize.cx + tcy / 2; } else { if(pass) { diff --git a/uppsrc/CtrlLib/Switch.cpp b/uppsrc/CtrlLib/Switch.cpp index 3ab985c00..b7e59cdda 100644 --- a/uppsrc/CtrlLib/Switch.cpp +++ b/uppsrc/CtrlLib/Switch.cpp @@ -222,7 +222,7 @@ void Switch::Paint(Draw& w) { } v.rect = hr; if(horz) - x += hr.Width() + tcy; + x += hr.Width() + tcy / 2; else y += linecy; }