From 078ac062e764b9b6a46110861f924e3df6328f20 Mon Sep 17 00:00:00 2001
From: Vicent Marti
Date: Fri, 25 Jul 2008 11:13:47 +0000
Subject: More triangle work
svn-id: r33286
---
graphics/VectorRenderer.cpp | 16 +++-------------
gui/ThemeDefaultXML.cpp | 4 ++--
2 files changed, 5 insertions(+), 15 deletions(-)
diff --git a/graphics/VectorRenderer.cpp b/graphics/VectorRenderer.cpp
index ce8868241b..352ab971a3 100644
--- a/graphics/VectorRenderer.cpp
+++ b/graphics/VectorRenderer.cpp
@@ -521,18 +521,13 @@ drawTriangle(int x, int y, int w, int h, TriangleOrientation orient) {
if (Base::_dynamicData != 0)
orient = (TriangleOrientation)Base::_dynamicData;
- int newW = w * 3 / 4;
+ int newW = w / 2;
if (newW % 2) newW++;
switch(orient) {
case kTriangleUp:
case kTriangleDown:
-// #ifdef VECTOR_RENDERER_FAST_TRIANGLES
- // if (w == h)
- drawTriangleFast(x + (w / 2) - w * 3 / 8, y + w / 4, newW, (orient == kTriangleDown), color, Base::_fillMode);
- // else
-// #endif
- // drawTriangleVertAlg(x, y, w, h, (orient == kTriangleDown), color, Base::_fillMode);
+ drawTriangleFast(x + (newW / 2), y + (h / 2) - (newW / 2), newW, (orient == kTriangleDown), color, Base::_fillMode);
break;
case kTriangleLeft:
@@ -543,12 +538,7 @@ drawTriangle(int x, int y, int w, int h, TriangleOrientation orient) {
if (Base::_strokeWidth > 0)
if (Base::_fillMode == kFillBackground || Base::_fillMode == kFillGradient) {
-#ifdef VECTOR_RENDERER_FAST_TRIANGLES
- if (w == h)
- drawTriangleFast(x, y, w, (orient == kTriangleDown), _fgColor, kFillDisabled);
- else
-#endif
- drawTriangleVertAlg(x, y, w, h, (orient == kTriangleDown), _fgColor, kFillDisabled);
+ drawTriangleFast(x + (newW / 2), y + (h / 2) - (newW / 2), newW, (orient == kTriangleDown), _fgColor, kFillDisabled);
}
}
diff --git a/gui/ThemeDefaultXML.cpp b/gui/ThemeDefaultXML.cpp
index 2e3c3b1270..97880dbdb2 100644
--- a/gui/ThemeDefaultXML.cpp
+++ b/gui/ThemeDefaultXML.cpp
@@ -107,14 +107,14 @@ bool ThemeRenderer::loadDefaultXML() {
""
""
--
cgit v1.2.3