aboutsummaryrefslogtreecommitdiff
path: root/generic
diff options
context:
space:
mode:
Diffstat (limited to 'generic')
-rw-r--r--generic/Draw.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/generic/Draw.c b/generic/Draw.c
index f7b4a11..9405546 100644
--- a/generic/Draw.c
+++ b/generic/Draw.c
@@ -1344,12 +1344,14 @@ ZnRenderTile(ZnWInfo *wi,
int width, height, num_clips = ZnListSize(wi->clip_stack);
unsigned short alpha;
GLuint texobj;
-
+ XColor *color;
+
if (gradient) {
- ZnGetGradientColor(gradient, 0.0, &alpha);
+ color = ZnGetGradientColor(gradient, 0.0, &alpha);
alpha = ZnComposeAlpha(alpha, wi->alpha);
}
else {
+ color = NULL;
alpha = ZnComposeAlpha(100, wi->alpha);
}
@@ -1371,7 +1373,12 @@ ZnRenderTile(ZnWInfo *wi,
ZnSizeOfImage(tile, &width, &height);
texobj = ZnImageTex(tile, &tilet, &tiles);
glEnable(GL_TEXTURE_2D);
- glColor4us(65535, 65535, 65535, alpha);
+ if (color && ZnImageIsBitmap(tile)) {
+ glColor4us(color->red, color->green, color->blue, alpha);
+ }
+ else {
+ glColor4us(65535, 65535, 65535, alpha);
+ }
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glBindTexture(GL_TEXTURE_2D, texobj);
@@ -1437,7 +1444,7 @@ ZnComputeAxialGradient(ZnWInfo *wi,
c = shape->contours;
ZnResetBBox(&bbox);
for (i = 0; i < shape->num_contours; i++, c++) {
- if (c->cw) {
+ if (c->cw && (shape->num_contours > 1)) {
continue;
}
ZnListAssertSize(wi->work_pts, c->num_points);
@@ -1484,7 +1491,7 @@ ZnComputeRadialGradient(ZnWInfo *wi,
c = shape->contours;
dist = 0.0;
for (j = 0; j < shape->num_contours; j++, c++) {
- if (c->cw) {
+ if (c->cw && (shape->num_contours > 1)) {
continue;
}
ZnAddPointsToBBox(&bbox, c->points, c->num_points);
@@ -1541,7 +1548,7 @@ ZnComputeRadialGradient(ZnWInfo *wi,
*/
c = shape->contours;
for (j = 0; j < shape->num_contours; j++, c++) {
- if (c->cw) {
+ if (c->cw && (shape->num_contours > 1)) {
continue;
}
for (i = 0, points = c->points; i < c->num_points; i++, points++) {
@@ -1590,7 +1597,7 @@ ZnComputePathGradient(ZnWInfo *wi,
ZnResetBBox(&bbox);
c = shape->contours;
for (j = 0; j < shape->num_contours; j++, c++) {
- if (c->cw) {
+ if (c->cw && (shape->num_contours > 1)) {
continue;
}
ZnAddPointsToBBox(&bbox, c->points, c->num_points);