explicit casts for double-to-int conversions

svn: r7441
This commit is contained in:
Matthew Flatt 2007-10-06 15:04:57 +00:00
parent 735fef2812
commit c9e87fe9ab

View File

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