From c9e87fe9ab31c3464db77613eec8b9f2beda5910 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Sat, 6 Oct 2007 15:04:57 +0000 Subject: [PATCH] explicit casts for double-to-int conversions svn: r7441 --- src/wxxt/src/DeviceContexts/WindowDC.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/wxxt/src/DeviceContexts/WindowDC.cc b/src/wxxt/src/DeviceContexts/WindowDC.cc index 374bdac7b4..ad1f775af9 100644 --- a/src/wxxt/src/DeviceContexts/WindowDC.cc +++ b/src/wxxt/src/DeviceContexts/WindowDC.cc @@ -2324,13 +2324,13 @@ void wxWindowDC::DrawText(char *orig_text, double x, double y, according to my experiments. */ col.pixel = current_text_fg->GetPixel(); v = current_text_fg->Red(); - v = v * current_alpha; + v = (int)(v * current_alpha); col.color.red = (v << 8) | v; v = current_text_fg->Green(); - v = v * current_alpha; + v = (int)(v * current_alpha); col.color.green = (v << 8) | v; v = current_text_fg->Blue(); - v = v * current_alpha; + v = (int)(v * current_alpha); col.color.blue = (v << 8) | v; col.color.alpha = (int)(current_alpha * 0xFFFF); @@ -2342,13 +2342,13 @@ void wxWindowDC::DrawText(char *orig_text, double x, double y, XftColor bg; bg.pixel = current_text_bg->GetPixel(); v = current_text_bg->Red(); - v = v * current_alpha; + v = (int)(v * current_alpha); bg.color.red = (v << 8) | v; v = current_text_bg->Green(); - v = v * current_alpha; + v = (int)(v * current_alpha); bg.color.green = (v << 8) | v; v = current_text_bg->Blue(); - v = v * current_alpha; + v = (int)(v * current_alpha); bg.color.blue = (v << 8) | v; bg.color.alpha = (int)(current_alpha * 0xFFFF); XftDrawRect(XFTDRAW, &bg, dev_x, dev_y, rw, xfontinfo->ascent + xfontinfo->descent);