Ticket #2856 (closed feature: duplicate)

Opened 3 years ago

Last modified 2 years ago

canvas renderer doesn't properly render interior rings in polygons

Reported by: tschaub Owned by: tschaub
Priority: minor Milestone: 2.11 Release
Component: Renderer.Canvas Version: 2.10
Keywords: Cc:
State:

Description

The canvas renderer needs to change the canvas context's globalCompositeOperation to properly erase interior rings from polygons. See  this Canvas.js for one way to do this.

Attachments

2856.patch Download (1.9 KB) - added by tschaub 2 years ago.
holes in polygons
Screen shot 2011-02-27 at 8.26.40 PM.png Download (73.0 KB) - added by crschmidt 2 years ago.
canvas.patch Download (1.9 KB) - added by crschmidt 2 years ago.

Change History

Changed 3 years ago by tschaub

  • owner changed from crschmidt to tschaub
  • status changed from new to assigned

Changed 2 years ago by tschaub

holes in polygons

Changed 2 years ago by crschmidt

Changed 2 years ago by crschmidt

In safari, after applying this patch, I get something that looks better, but still 'not quite right'; it looks fine when I'm sketching, but as soon as the geometry is finalized, it has a 'half-fill' look to it.

I guess the fact that it looks okay while sketching isn't new; it looks like that's the case even without this change, so I guess that's not relevant. (But maybe helps to better understand a potential fix? Ohhhh, wait. The sketch handler is using the default SVG stuff on a separate layer, so that's why it works. Okay, so ignore that :)

Okay, so knowing that, I think this is just because we're not setting the fillOpacity to 1.0 when drawing the inner ring. Attaching a patch that does that, which seems to fix the behavior I'm seeing.

Changed 2 years ago by crschmidt

Changed 2 years ago by tschaub

I've incorporated the fix for this into the patch for #3207. Proper hit detection of polygons with holes requires better rendering of holes.

Changed 2 years ago by tschaub

  • status changed from assigned to closed
  • resolution set to duplicate

In w/ r11850.

Note: See TracTickets for help on using tickets.