summaryrefslogtreecommitdiff
path: root/Build/source/utils/asymptote/patches/TkAlpha-Imaging-1.1.6msdos.patch
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/utils/asymptote/patches/TkAlpha-Imaging-1.1.6msdos.patch')
-rw-r--r--Build/source/utils/asymptote/patches/TkAlpha-Imaging-1.1.6msdos.patch52
1 files changed, 52 insertions, 0 deletions
diff --git a/Build/source/utils/asymptote/patches/TkAlpha-Imaging-1.1.6msdos.patch b/Build/source/utils/asymptote/patches/TkAlpha-Imaging-1.1.6msdos.patch
new file mode 100644
index 00000000000..8e946963685
--- /dev/null
+++ b/Build/source/utils/asymptote/patches/TkAlpha-Imaging-1.1.6msdos.patch
@@ -0,0 +1,52 @@
+--- Imaging-1.1.6/Tk/tkImaging.c.orig 2006-12-03 04:37:29.000000000 -0700
++++ Imaging-1.1.6/Tk/tkImaging.c 2007-05-15 11:37:54.000000000 -0600
+@@ -39,10 +39,7 @@
+ * See the README file for information on usage and redistribution.
+ */
+
+-/* This is needed for (at least) Tk 8.4.1, otherwise the signature of
+-** Tk_PhotoPutBlock changes.
+-*/
+-#define USE_COMPOSITELESS_PHOTO_PUT_BLOCK
++#define TKMAJORMINOR (TK_MAJOR_VERSION*1000 + TK_MINOR_VERSION)
+
+ /* This is needed for (at least) Tk 8.4.6 and later, to avoid warnings
+ for the Tcl_CreateCommand command. */
+@@ -125,7 +122,10 @@
+ block.offset[0] = 0;
+ block.offset[1] = 1;
+ block.offset[2] = 2;
+- block.offset[3] = 0; /* no alpha (or reserved, under 8.2) */
++ if(strcmp(im->mode,"RGBA")==0)
++ block.offset[3] = 3; /*alpha (or reserved, under 8.2)*/
++ else
++ block.offset[3] = 0; /* no alpha */
+ } else {
+ Tcl_AppendResult(interp, "Bad mode", (char*) NULL);
+ return TCL_ERROR;
+@@ -140,7 +140,7 @@
+ src_yoffset * im->linesize +
+ src_xoffset * im->pixelsize;
+ #endif
+-
++#if TKMAJORMINOR < 8004 /* Tk < 8.4.0 */
+ if (strcmp(im->mode, "RGBA") == 0) {
+ /* Copy non-transparent pixels to photo image */
+ int x, y;
+@@ -193,6 +193,16 @@
+ /* Copy opaque block to photo image, and leave the rest to TK */
+ Tk_PhotoPutBlock(photo, &block, 0, 0, block.width, block.height);
+
++#else /* Tk >= 8.4.0 */
++ Tk_PhotoPutBlock(photo, &block, 0, 0, block.width, block.height,
++ TK_PHOTO_COMPOSITE_SET);
++ if (strcmp(im->mode, "RGBA") == 0)
++ /* Tk workaround: we need apply ToggleComplexAlphaIfNeeded */
++ /* (fixed in Tk 8.5a3) */
++ Tk_PhotoSetSize(photo, block.width, block.height);
++#endif
++
++
+ return TCL_OK;
+ }
+