summaryrefslogtreecommitdiff
path: root/views/view.c
diff options
context:
space:
mode:
Diffstat (limited to 'views/view.c')
-rw-r--r--views/view.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/views/view.c b/views/view.c
index 3b72253..75a24e0 100644
--- a/views/view.c
+++ b/views/view.c
@@ -251,6 +251,9 @@ void cView::DrawPixmap(int num, cTemplatePixmap *pix, map < string, vector< map<
case ftDrawEllipse:
DoDrawEllipse(num, func);
break;
+ case ftDrawSlope:
+ DoDrawSlope(num, func);
+ break;
case ftDrawImage:
DoDrawImage(num, func);
break;
@@ -348,6 +351,9 @@ void cView::DrawLoop(int numPixmap, cTemplateFunction *func, map < string, vecto
case ftDrawEllipse:
DoDrawEllipse(numPixmap, func, x0, y0);
break;
+ case ftDrawSlope:
+ DoDrawSlope(numPixmap, func, x0, y0);
+ break;
case ftDrawImage:
DoDrawImage(numPixmap, func, x0, y0);
break;
@@ -634,9 +640,32 @@ void cView::DoDrawEllipse(int num, cTemplateFunction *func, int x0, int y0) {
cRect size(x, y, w, h);
tColor clr = func->GetColorParameter(ptColor);
int quadrant = func->GetNumericParameter(ptQuadrant);
+ if (quadrant < -4 || quadrant > 8) {
+ esyslog("skindesigner: wrong quadrant %d for drawellipse, allowed values are from -4 to 8", quadrant);
+ quadrant = 0;
+ }
DrawEllipse(num, size, clr, quadrant);
}
+void cView::DoDrawSlope(int num, cTemplateFunction *func, int x0, int y0) {
+ int x = func->GetNumericParameter(ptX);
+ int y = func->GetNumericParameter(ptY);
+ if (x < 0) x = 0;
+ x += x0;
+ if (y < 0) y = 0;
+ y += y0;
+ int w = func->GetNumericParameter(ptWidth);
+ int h = func->GetNumericParameter(ptHeight);
+ cRect size(x, y, w, h);
+ tColor clr = func->GetColorParameter(ptColor);
+ int type = func->GetNumericParameter(ptType);
+ if (type < 0 || type > 7) {
+ esyslog("skindesigner: wrong type %d for drawslope, allowed values are from 0 to 7", type);
+ type = 0;
+ }
+ DrawSlope(num, size, clr, type);
+}
+
void cView::DoDrawImage(int num, cTemplateFunction *func, int x0, int y0) {
int x = func->GetNumericParameter(ptX);
int y = func->GetNumericParameter(ptY);