Commit c4f6b338 authored by Christoffer Ackelman's avatar Christoffer Ackelman Committed by Esteban Blanc

QT: Fixed drawing rotated text in Glow, QT rotates clockwise, not anti-clockwise like GTK.

parent 13ca247b
......@@ -2917,10 +2917,7 @@ int GlowDrawQt::text_qt(GlowWind* wind, int x, int y, char* text, int len,
str = QString::fromUtf8(text);
}
if (rot != 0) {
rot = 360 - rot;
painter->rotate(rot);
}
painter->rotate(rot);
painter->setFont(get_font(font_idx, painter_type, size));
......@@ -2932,19 +2929,19 @@ int GlowDrawQt::text_qt(GlowWind* wind, int x, int y, char* text, int len,
int px, py;
if (rot == 180) {
px = -x - width;
py = (int)(-y - FONT_DESCENT * height);
} else if (rot == 90) {
py = -y - FONT_DESCENT * height;
} else if (rot == 270) {
px = -y - width + height / 2;
py = x;
} else if (rot == 270) {
} else if (rot == 90) {
px = y - width;
py = -x - height;
} else {
px = x;
py = (int)(y - (1.0 - FONT_DESCENT) * height);
py = y - (1.0 - FONT_DESCENT) * height;
}
painter->drawText(px, py, rect.width(), rect.height(), Qt::TextDontClip, str);
painter->rotate(-rot);
return 1;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment