Slight fix for shadows; we were drawing an unnecessary layer of text.

This commit is contained in:
Andrzej Kapolka 2013-05-16 16:23:11 -07:00
parent 700d3de4aa
commit 00171eccbb
2 changed files with 2 additions and 2 deletions

View file

@ -139,7 +139,7 @@ const Glyph& TextRenderer::getGlyph(char c) {
painter.setFont(_font);
if (_effectType == SHADOW_EFFECT) {
for (int i = 0; i < _effectThickness; i++) {
painter.drawText(-bounds.x() - i, -bounds.y() + i, ch);
painter.drawText(-bounds.x() - 1 - i, -bounds.y() + 1 + i, ch);
}
} else if (_effectType == OUTLINE_EFFECT) {
QPainterPath path;

View file

@ -26,7 +26,7 @@ public:
enum EffectType { NO_EFFECT, SHADOW_EFFECT, OUTLINE_EFFECT };
TextRenderer(const char* family, int pointSize = -1, int weight = -1, bool italic = false,
EffectType effect = NO_EFFECT, int effectThickness = 2);
EffectType effect = NO_EFFECT, int effectThickness = 1);
~TextRenderer();
const QFontMetrics& metrics() const { return _metrics; }