Skip to content

feat: fire 'update' event and set 'edited' state on opacity change#1411

Open
themacboy wants to merge 5 commits into
publiclab:mainfrom
themacboy:feature-opacity-update
Open

feat: fire 'update' event and set 'edited' state on opacity change#1411
themacboy wants to merge 5 commits into
publiclab:mainfrom
themacboy:feature-opacity-update

Conversation

@themacboy

Copy link
Copy Markdown
Contributor

Description

This PR ensures that changing the overlay opacity sets the edited state to true and triggers the 'update' event.

Previously, geometric changes (translation, rotation, scale, distortion) correctly updated the edited status to true and fired the 'update' event on the DistortableImageOverlay instance. However, opacity modifications via _toggleOpacity and _setOpacities only updated the DOM element without notifying consumers.

Changes

  • Set this._overlay.edited = true and fired the 'update' event in _toggleOpacity() (DistortableImage.Edit.js).
  • Set this._overlay.edited = true and fired the 'update' event in _setOpacities() (DistortableImage.Edit.js).

Use Case

This allows developers to listen to the 'update' event on the overlay as a single source of truth for detecting any unsaved changes (whether geometric or visual) to an overlay on the map.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants