OpenLayers OpenLayers

Ticket #1172 (closed bug: fixed)

Opened 9 months ago

Last modified 9 months ago

VML renderer problems with externalGraphic

Reported by: ahocevar Assigned to:
Priority: major Milestone: 2.6 Release
Component: Renderer Version: SVN
Keywords: Cc:
State:

Description

The changes of http://trac.openlayers.org/changeset/5158 are breaking the VML renderer for externalGraphic:

  • A border will be rendered around the image.
  • Opacity does not render correctly any more. A semi-opaque white rectangle will appear around the image if an opacity different than 1 is specified.

If vector-features.html.patch is applied to the trunk, this behaviour can be seen in the "vector-features.html" example.

The attached patch "Renderer.diff" fixes this issue, along with a minor performance improvement and code cleanup. Renderer/Elements, Renderer/VML and Renderer/SVG are affected:

  • Changed the getNodeType method: added second parameter "style", because the node type can be different depending on styles (if externalGraphic is specified, the node type will be different than in plain points).
  • The above change enables us to remove the code in Renderer/VML and Renderer/SVG that overwrites the existing node in the setStyle method when an externalGraphic style is specified.
  • Added a new method postDraw. Only Renderer/VML implements this method. It compares the fillcolor and strokecolor attributes of the rendered node to the requested style. If those differ, they will be set again. This fixes the second issue described above.
  • In Renderer/VML.js, options.isStroked is set to false for nodes with an externalGraphic style instead of setting style.strokecolor to "none". This fixes the first issue described above.

Attachments

vector-features.html.2.patch (1.9 kB) - added by ahocevar on 11/25/07 17:20:09.
vector-features.html.patch (1.9 kB) - added by ahocevar on 11/25/07 17:21:43.
Please use this patch for the example, the other one has absolute paths.
Renderer.diff (10.0 kB) - added by ahocevar on 11/26/07 04:27:03.
This is the bugfix. This patch is to be applied after testing with the patched vector-features.html example, to see the before/after effect. The postDraw hack for the fillColor flaw in IE is only needed if fillcolor is "none", so we only check for that
Renderer.2.diff (10.0 kB) - added by ahocevar on 12/01/07 17:51:47.
re-diffed from current trunk

Change History

11/25/07 17:20:09 changed by ahocevar

  • attachment vector-features.html.2.patch added.

11/25/07 17:21:43 changed by ahocevar

  • attachment vector-features.html.patch added.

Please use this patch for the example, the other one has absolute paths.

11/26/07 04:27:03 changed by ahocevar

  • attachment Renderer.diff added.

This is the bugfix. This patch is to be applied after testing with the patched vector-features.html example, to see the before/after effect. The postDraw hack for the fillColor flaw in IE is only needed if fillcolor is "none", so we only check for that

12/01/07 09:10:23 changed by crschmidt

Andreas:

This patch looks good, but something's broken in the last line of it for some reason: patch is saying:

patch: **** malformed patch at line 141:

Can you try rediffing the file and reuploading it? Trac doesn't seem to have a problem with it, so I don't know if this will help, but i'd prefer not to apply it by hand if I can avoid it.

12/01/07 17:51:47 changed by ahocevar

  • attachment Renderer.2.diff added.

re-diffed from current trunk

12/01/07 17:53:00 changed by crschmidt

That worked, thanks.

12/01/07 17:58:00 changed by crschmidt

  • keywords deleted.
  • status changed from new to closed.
  • resolution set to fixed.

(In [5323]) Fixes and performance improvements to VML renderer problems with externalGraphic, diligently filed, investigated, and fixed by The great and powerful Oz, er, Andreas, who is becoming my new vector rendering hero. (Closes #1172)