1
=== modified file 'plugins/resize/src/resize.cpp'
2
--- a/plugins/resize/src/resize.cpp 2011-03-14 16:12:45 +0000
3
+++ b/plugins/resize/src/resize.cpp 2011-04-07 15:35:23 +0000
5
unsigned short *borderColor,
6
unsigned short *fillColor)
9
- GLMatrix sTransform (transform);
11
+ GLMatrix sTransform (transform);
12
+ GLint origSrc, origDst;
13
+ float_t fc[4], bc[4];
15
+ glGetIntegerv (GL_BLEND_SRC, &origSrc);
16
+ glGetIntegerv (GL_BLEND_DST, &origDst);
18
+ /* Premultiply the alpha values */
20
+ bc[3] = (float) borderColor[3] / (float) 65535.0f;
21
+ bc[0] = ((float) borderColor[0] / 65535.0f) * bc[3];
22
+ bc[1] = ((float) borderColor[1] / 65535.0f) * bc[3];
23
+ bc[2] = ((float) borderColor[2] / 65535.0f) * bc[3];
25
getPaintRectangle (&box);
27
@@ -1496,16 +1508,22 @@
29
glDisableClientState (GL_TEXTURE_COORD_ARRAY);
31
+ glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
36
- glColor4usv (fillColor);
37
+ fc[3] = (float) fillColor[3] / (float) 65535.0f;
38
+ fc[0] = ((float) fillColor[0] / 65535.0f) * fc[3];
39
+ fc[1] = ((float) fillColor[1] / 65535.0f) * fc[3];
40
+ fc[2] = ((float) fillColor[2] / 65535.0f) * fc[3];
42
+ glColor4f (fc[0], fc[1], fc[2], fc[3]);
43
glRecti (box.x1, box.y2, box.x2, box.y1);
47
- glColor4usv (borderColor);
48
+ glColor4f (bc[0], bc[1], bc[2], bc[3]);
50
glBegin (GL_LINE_LOOP);
51
glVertex2i (box.x1, box.y1);