summaryrefslogtreecommitdiff
path: root/src/staticswitcher.cpp
diff options
context:
space:
mode:
authorErkin Bahceci <erkinbah@gmail.com>2009-12-25 15:02:08 -0600
committerErkin Bahceci <erkinbah@gmail.com>2009-12-25 15:02:08 -0600
commitcd624f41169c795e2090dffd4166904361381979 (patch)
treea98e7f8d3a9a798a2b91a93ca8e437583926f36f /src/staticswitcher.cpp
parent0ad4e9501110167423cde172d433f9424e5a3fbb (diff)
downloadstaticswitcher-cd624f41169c795e2090dffd4166904361381979.tar.gz
staticswitcher-cd624f41169c795e2090dffd4166904361381979.tar.bz2
Paint icons at the same size.
Diffstat (limited to 'src/staticswitcher.cpp')
-rw-r--r--src/staticswitcher.cpp22
1 files changed, 4 insertions, 18 deletions
diff --git a/src/staticswitcher.cpp b/src/staticswitcher.cpp
index efeeff0..b6c5303 100644
--- a/src/staticswitcher.cpp
+++ b/src/staticswitcher.cpp
@@ -1048,10 +1048,8 @@ StaticSwitchWindow::updateIconTexturedWindow (GLWindowPaintAttrib &sAttrib,
{
float xScale, yScale;
- xScale = (icon->width () > ICON_SIZE) ?
- (float) ICON_SIZE / icon->width () : 1.0;
- yScale = (icon->height () > ICON_SIZE) ?
- (float) ICON_SIZE / icon->height () : 1.0;
+ xScale = (float) ICON_SIZE / icon->width ();
+ yScale = (float) ICON_SIZE / icon->height ();
if (xScale < yScale)
yScale = xScale;
@@ -1075,20 +1073,8 @@ StaticSwitchWindow::updateIconNontexturedWindow (GLWindowPaintAttrib &sAttrib,
int y,
GLTexture *icon)
{
- float iw, ih;
-
- iw = width;
- ih = height;
-
- if (icon->width () < (iw / 2) || icon->width () > iw)
- sAttrib.xScale = (iw / icon->width ());
- else
- sAttrib.xScale = 1.0f;
-
- if (icon->height () < (ih / 2) || icon->height () > ih)
- sAttrib.yScale = (ih / icon->height ());
- else
- sAttrib.yScale = 1.0f;
+ sAttrib.xScale = width / icon->width ();
+ sAttrib.yScale = height / icon->height ();
if (sAttrib.xScale < sAttrib.yScale)
sAttrib.yScale = sAttrib.xScale;