Ticket #2608 (closed bug: fixed)

Opened 3 years ago

Last modified 3 years ago

external graphics not displayed when drawing after linestring

Reported by: arno Owned by: fredj
Priority: minor Milestone: 2.10 Release
Component: Renderer.Canvas Version: 2.9
Keywords: Cc:
State: Complete

Description

Hi, when drawing a linestring, then a point whose style has externalGraphic property, external graphic is not displayed if linestring is drawn just before (or just after). That's because after drawing a line string, canvas style is reset, ie: globalAlpha is set to 0.

Before drawing image (by calling this.canvas.drawImage), globalAlpha is not set back. Then image is drawn with alpha 0, and therefore does is not displayed.

See testcase  http://renevier.net/bugs/ol_canvas_extgraph.html a linestring and two points are drawn. With canvas backend, points are not drawn; with svg, points are drawn.

Attachments

svg_backend.png Download (156.5 KB) - added by arno 3 years ago.
screenshot with svg backend
canvas_backend.png Download (154.8 KB) - added by arno 3 years ago.
screenshot with canvas backend
2608.0.patch Download (1.4 KB) - added by fredj 3 years ago.
Use the graphicOpacity to set canvas.globalAlpha. Move the src assignment after the onload

Change History

Changed 3 years ago by arno

screenshot with svg backend

Changed 3 years ago by arno

screenshot with canvas backend

Changed 3 years ago by fredj

Use the graphicOpacity to set canvas.globalAlpha. Move the src assignment after the onload

Changed 3 years ago by fredj

  • state set to Review

please review

Changed 3 years ago by crschmidt

  • owner changed from crschmidt to fredj
  • state changed from Review to Commit

Patch looks good, fredj. This is an obvious oversight in the code. Please commit.

Changed 3 years ago by fredj

  • status changed from new to closed
  • state changed from Commit to Complete
  • resolution set to fixed
Note: See TracTickets for help on using tickets.