From a2bf9191fe081c67484eed5786bcc0d5c65aecd2 Mon Sep 17 00:00:00 2001 From: skyjake Date: Mon, 16 Sep 2013 09:12:41 +0300 Subject: [PATCH] Fixed|UI|Client: Alignment issue due unsigned math The "No LOD" label of a slider was missing because negative values were interpreted as large positive values. --- doomsday/client/include/ui/uidefs.h | 2 +- doomsday/client/src/ui/widgets/sliderwidget.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doomsday/client/include/ui/uidefs.h b/doomsday/client/include/ui/uidefs.h index 2567782730..ee050a3040 100644 --- a/doomsday/client/include/ui/uidefs.h +++ b/doomsday/client/include/ui/uidefs.h @@ -96,7 +96,7 @@ typename RectType::Corner applyAlignment(Alignment align, SizeType const &size, } else if(!align.testFlag(AlignTop)) { - p.y += de::floor(double(bounds.height() - size.y) / 2.0); + p.y += de::floor((double(bounds.height()) - double(size.y)) / 2.0); } return p; diff --git a/doomsday/client/src/ui/widgets/sliderwidget.cpp b/doomsday/client/src/ui/widgets/sliderwidget.cpp index 6bb3d9317b..078deb82b4 100644 --- a/doomsday/client/src/ui/widgets/sliderwidget.cpp +++ b/doomsday/client/src/ui/widgets/sliderwidget.cpp @@ -260,7 +260,7 @@ DENG_GUI_PIMPL(SliderWidget) verts.makeFlexibleFrame(slider.expanded(5), 6, Vector4f(1, 1, 1, frameOpacity), atlas().imageRectf(root().gradientFrame())); - // Labels. + // Labels. if(labels[Start].isReady()) { labels[Start].makeVertices(verts,