Ticket #1737 (closed bug: fixed)

Opened 5 years ago

Last modified 4 years ago

Popup.FramedCloud Doesn't Work Well With Slightly Transparent Background Images

Reported by: openlayers Owned by: euzuro
Priority: minor Milestone: 2.8 Release
Component: Popup.FramedCloud Version: 2.7 RC2
Keywords: Cc: chris@…
State: Complete

Description

I was experimenting with the FramedCloud popup in 2.7-RC2 and I wanted to have a slightly transparent popup, while retaining the frame.

I replaced the image source:trunk/openlayers/img/cloud-popup-relative.png with a custom one I made such that instead of white, the background is black and slightly transparent (see attached file).

However, doing this by itself didn't work as the values in FramedCloud.positionBlocks under the size, anchor and position properties weren't correct in all cases. This left me with some overlap between the 5 pieces that make up the final image. When there is transparency involved, this gets ugly.

To reproduce this behavior, drop in the attached image file as a replacement for source:trunk/openlayers/img/cloud-popup-relative.png and view the popupMatrix.html example. Create some FramedCloud popups where the stem is on the bottom of the popup and you'll see the overlap (or missing background in the case when the stem is in the lower right corner).

So I did some tweaking and got what I found to seem to be correct values. I wanted to let you guys know what they are and let you do with the changes as you see fit.

I attached the patch I made based off 2.7-RC2.

Attachments

FramedCloud.js.patch Download (3.4 KB) - added by openlayers 5 years ago.
Patch for description of the bug.
cloud-popup-relative.png Download (6.7 KB) - added by openlayers 5 years ago.
Transparent version of cloud-popup-relative.png

Change History

Changed 5 years ago by openlayers

Patch for description of the bug.

Changed 5 years ago by openlayers

Transparent version of cloud-popup-relative.png

Changed 5 years ago by euzuro

  • milestone set to 2.8 Release

Thanks for the report, chris. At the moment, we are in the heat of a release cycle, so I'm going to push this to 2.8, but we thank you for this nice ticket.

Changed 5 years ago by euzuro

  • owner set to euzuro
  • status changed from new to assigned

Changed 5 years ago by openlayers

Cool. I figured it was too late for 2.7, and knew you guys would know the right thing to do for this. Let me know if you have any questions about it.

Changed 4 years ago by crschmidt

  • status changed from assigned to closed
  • state set to Complete
  • resolution set to fixed

(In [8904]) Fix broken positionBlocks, which cuased overlaps. This is neccesary to easily handle semi-transparent alternatives to the main framedcloud image.

r=me, (Closes #1737)

Note: See TracTickets for help on using tickets.