Tk Source Code

View Ticket
Login
Ticket UUID: 95da0f12179ea6ccf9d1585fce00421b8b324de0
Title: tkpWinRopModes[GXnoop] is R2_NOT, should be R2_NOP
Type: Bug Version: 8.6.13
Submitter: chrstphrchvz Created on: 2025-09-28 01:12:49
Subsystem: 82. X11 Emulation Assigned To: nobody
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2025-10-01 02:43:54
Resolution: Fixed Closed By: chrstphrchvz
    Closed on: 2025-10-01 02:43:54
Description:

I notice this likely typo in tkWinDraw.c:

const int tkpWinRopModes[] = {
      ⋮
   R2_NOT,         /* GXnoop */
      ⋮
   R2_NOT,         /* GXinvert */

I.e. tkpWinRopModes[GXnoop] does the same thing as tkpWinRopModes[GXinvert], which does not seem right. I can check the behavior using the canvas items widget demo by making this other change:

--- win/tkWinDraw.c
+++ win/tkWinDraw.c
@@ -1217,7 +1217,7 @@ DrawOrFillArc(
 
     dc = TkWinGetDrawableDC(display, d, &state);
 
-    SetROP2(dc, tkpWinRopModes[gc->function]);
+    SetROP2(dc, tkpWinRopModes[GXnoop]);
 
     /*
      * Compute the absolute starting and ending angles in normalized radians.

The current behavior is that moving the arc and oval items over earlier-drawn items causes their colors to be inverted (see notarcs.png, notrects.png).

By correcting tkpWinRopModes[GXnoop] to instead be R2_NOP, oval items are now invisible, and only the line segment portions of arc shape items are visible (see nooparcs.png).

User Comments: jan.nijtmans added on 2025-09-30 09:19:22:

+1. Just go ahead!


Attachments: