| Ticket UUID: | 220787 | |||
| Title: | Stipple patterns don't work in arc/oval items on Windows/Mac | |||
| Type: | Bug | Version: | 8.2, 8.6.18, 9.0.5, 9.1.0 | |
| Submitter: | welch | Created on: | 2000-11-01 00:54:06 | |
| Subsystem: | 05. Canvas Items | Assigned To: | jan.nijtmans | |
| Priority: | 5 Medium | Severity: | Minor | |
| Status: | Pending | Last Modified: | 2026-10-24 12:20:31 | |
| Resolution: | Fixed | Closed By: | nobody | |
| Closed on: | 2017-12-13 23:35:23 | |||
| Description: |
OriginalBugID: 1274 Bug Version: 8.2 SubmitDate: '1999-02-23' LastModified: '2000-04-03' Severity: SER Status: Assigned Submitter: pat ChangedBy: ericm RelatedBugIDs: 1379 555 610 4081 4077 2495 OS: All Windows Machine: X86 Name: Christopher Nelson ReproducibleScript: canvas .c pack .c .c create oval 1i 1i 2i 2i -fill black -stipple gray50 ObservedBehavior: The oval is drawn black, no fill pattern. DesiredBehavior: A 50% gray oval. Stippling is not yet (as of 8.2.0 still) implement for non-Unix platforms. -- 08/14/1999 hobbs Some aspects of stippling work, but not most (see 4077, 4081). -- 03/27/2000 hobbs | |||
| User Comments: |
serhiy.storchaka added on 2026-10-24 12:20:31:
Thank you, Jan. The differences are probably caused by the color space conversion on macOS. stippleColors in canvas.test and canvRect.test could compare the colors with a small tolerance, as pixelNear in imgPhInstance.test does. jan.nijtmans added on 2026-10-24 11:21:22: > it can be removed when the macos-stipple branch is merged Unfortunately, the notAqua constraints cannot be removed yet. The macOS changes itself are now merged to trunk and core-9-0-branch too. I'm seeing:
canvRect.test
==== canvRect-13.1 stippled oval fill - bug 220787 FAILED
==== Contents of test case:
.c create oval 10 10 110 110 -fill red -stipple gray50 -outline {}
update
stippleColors .c 60 60
---- Result was:
#ff0200 #ffffff
---- Result should have been (exact matching):
#ff0000 #ffffff
==== canvRect-13.1 FAILED
==== canvRect-13.2 stippled oval outline - bug 220787 FAILED
==== Contents of test case:
.c create oval 10 10 110 110 -fill {} -outline blue -outlinestipple gray50 -width 6
update
stippleColors .c 60 10
---- Result was:
#0301ff #ffffff
---- Result should have been (exact matching):
#0000ff #ffffff
==== canvRect-13.2 FAILED
==== canvRect-13.3 stippled rectangle outline - bug 220059 FAILED
==== Contents of test case:
.c create rectangle 10 10 110 110 -fill {} -outline blue -outlinestipple gray50 -width 6
update
stippleColors .c 60 10
---- Result was:
#0301ff #ffffff
---- Result should have been (exact matching):
#0000ff #ffffff
==== canvRect-13.3 FAILED
serhiy.storchaka added on 2026-10-24 08:53:07: The new stipple tests failed on Aqua in CI, since Aqua does not support stippling yet. I added the notAqua constraint to canvas-27.1, canvas-27.2 and canvRect-13.1 to 13.3 in [e277e5e56a]; it can be removed when the macos-stipple branch is merged. kevin_walzer added on 2026-10-24 02:10:08: Does the macos-stipple branch accomplish what is needed here? I took Christopher's suggested API and screen shot as an example - see my attached screen shot. chrstphrchvz added on 2026-10-23 23:58:36: I have a stale draft implementation of stippling for Aqua from a few years ago: see [3bfa5eb4] if interested. kevin_walzer added on 2026-10-23 14:02:49: Stippling is not, to my knowledge, supported on CoreGraphics/macOS. jan.nijtmans added on 2026-10-23 13:55:59: Tested on MacOS as well... I see a black oval, no fill pattern. Conclusion: a similar fix will be needed for MacOS too. jan.nijtmans added on 2026-10-23 13:50:10: Fixed in [f34f83d4e1f75181|trunk]. Tested on Windows: just works fine! If CI is OK, can be backported further. serhiy.storchaka added on 2026-10-22 22:49:15: Re-tested on Windows 11 with today's main: stippled ovals, arc pie slices and rectangle outlines are still drawn solid. Branch win-canvas-arc-stipple still fixes all of them, and canvas.test, canvRect.test and canvArc.test pass with it. The Windows part is ready for review; the macOS part is still open. serhiy.storchaka added on 2026-09-22 07:22:32: On Windows the stipple of the GC was ignored when drawing arcs (fill and outline of arc, oval and chord/pie-slice items) and rectangle outlines, while polygons, lines and rectangle fills honoured it. Fixed in [72e46db680] (branch win-canvas-arc-stipple): the rendering through the stipple pattern used for polygons and lines is moved to a shared RenderStippled() and used for arcs and rectangle outlines too, so the -fill/-outline colors are honoured and opaque stipples use the background color. This also covers the closed duplicates [220059] (rectangle -outlinestipple) and [220058] (oval -stipple/-outlinestipple). Tests canvRect-13.1, 13.2, 13.3 and canvas-27.1, 27.2 check the stippling with testpixel; they pass on X11 and on Windows with the fix and fail on Windows without it. The rendering of a canvas with stippled ovals, arcs of the three styles, rectangles, polygons and lines is now the same as on X11 up to rounding at the curve edges. The macOS part is not addressed; I cannot test on macOS. fvogel added on 2018-09-10 20:48:01: Link to the patch proposed ten years ago that I just rediscovered: [1493260fff] fvogel added on 2017-12-12 20:33:23: See [f3e40e98d4] for an attempt of a fix. nijtmans added on 2010-04-29 22:47:34: Still not fixed in Tk 8.6b1 eabrek added on 2009-07-07 15:51:14: I installed Activestate Tcl 8.5.5.0 a while back. This bug is still present. Is there some problem with the patch? pcaffin added on 2008-03-13 15:59:26: Logged In: YES user_id=2029956 Originator: NO I've tested this bug using Tk 8.5.2.0.284581 (teapot) on both Windows XP Pro and Mac OS X 8.4. The issue is still present on both platforms. Did the patch provided by 'nobody' on 2006-05-23 16:09 get tested or applied? nobody added on 2006-05-23 15:09:29: Logged In: NO Xref: patch 1493260 nobody added on 2006-05-23 05:43:22: Logged In: NO I am posting the code in the patches section. eabrek added on 2006-05-20 02:59:06: Logged In: YES user_id=896923 I have fixed the bug to my satisfaction on my machine. I'd like someone to look it over for integration into the main code. What is the best way to go about that? Thanks! The fix makes use of http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/dnargdi/html/msdn_transblt.asp It is about 60 lines of code. I am uncertain of the usage of FillOpaqueStippled, so I am probably doing that wrong. It seems possible to restructure the rectangle version to be more like this, and possibly set up a function that both could use. eabrek added on 2006-05-12 01:12:31: Logged In: YES user_id=896923 Is someone working on this bug? It impacts me directly, so I will fix it if necessary. Please email me if I need to fix this. Thanks! dkf added on 2006-03-08 05:31:56: Logged In: YES user_id=79902 doc update applied; keeping open as it would still be nice to fix the bug (if possible) reowen added on 2006-03-08 02:56:08: Logged In: YES user_id=431773 As of Aqua Tk 8.4.12 rectangles ignore stipple. I've not tried other canvas shapes. May I suggest adding a warning to the documentation about using stipple on non-unix platforms? hobbs added on 2005-12-08 00:42:42: Logged In: YES user_id=72656 It most certainly works on unix, but remember that you need to use -outlinestipple. jaspert added on 2005-12-07 23:36:00: Logged In: YES user_id=456242 As of TclTk 8.4.9 oval outlines, and the curved part of arc outlines, do not stipple on _any_platform_! bach added on 2001-12-13 23:36:43: Logged In: YES user_id=98533 For 8.3.4, stippleborders work for polygons, but not for rectangles (Win NT). dkf added on 2000-12-03 01:58:02: Confirmed in 8.3.0. And at the same time I noticed that thick ovals (-width 5) don't look to me to have a constant width on this Win98 machine at least. Strange... | |||
Attachments:
- Screenshot 2026-10-23 at 10.00.19 PM.png [download] added by kevin_walzer on 2026-10-24 02:07:19. [details]
