Ticket #1427 (closed feature: fixed)

Opened 5 years ago

Last modified 5 years ago

The beforefeaturemodified event should be triggered before vertices get rendered

Reported by: tschaub Owned by: tschaub
Priority: critical Milestone: 2.7 Release
Component: Control.ModifyFeature Version: 2.5
Keywords: Cc:
State: Complete

Description

In order to let listeners decide what to do before modification begins, the beforefeaturemodified event should get triggered before vertices get rendered. In addition, we should respect the return. As with other listeners, you should be able to return false to stop execution.

Attachments

beforefeaturemodified.patch Download (1.0 KB) - added by tschaub 5 years ago.
trigger before action
patch-1427-r7159-A0.diff Download (1.0 KB) - added by elemoine 5 years ago.
patch-1427-r7546-A1.diff Download (3.2 KB) - added by elemoine 5 years ago.
t1427.patch Download (10.5 KB) - added by tschaub 5 years ago.
feature select and modify events

Change History

Changed 5 years ago by tschaub

trigger before action

Changed 5 years ago by crschmidt

  • state set to Review

Looks like this is okay to review? Change back if otherwise.

Changed 5 years ago by elemoine

this patch is wrong because this.feature isn't properly set when beforefeaturemodified is triggered. proper patch to come...

Changed 5 years ago by elemoine

Changed 5 years ago by elemoine

with patch-1427-r7159-A0.diff applied, all unit tests pass on FF2, please review

Changed 5 years ago by crschmidt

Can we cook up a quick test for this? I can try if no one else cares.

Changed 5 years ago by elemoine

Changed 5 years ago by elemoine

See patch-1427-r7546-A1.diff. Except, Layer/MultiMap.html, all unit tests pass on FF2 and FF3.

Changed 5 years ago by euzuro

  • priority changed from minor to critical

Changed 5 years ago by tschaub

In order to avoid having the feature selected at all, I added a beforefeatureselected event. The modify feature control listens to this and triggers beforefeaturemodified. If the listener returns false, the feature is not selected or modified.

Changed 5 years ago by euzuro

  • owner changed from tschaub to ahocevar

Changed 5 years ago by tschaub

feature select and modify events

Changed 5 years ago by elemoine

This is looking good. Please commit.

Changed 5 years ago by ahocevar

  • owner changed from ahocevar to tschaub
  • state changed from Review to Commit

Yes, this is really looking good. If tests pass, please go ahead and commit.

Changed 5 years ago by tschaub

  • status changed from new to closed
  • state changed from Commit to Complete
  • resolution set to fixed

(In [7616]) Adding a beforefeatureselected event to the vector layer events. If a listener returns false, the feature is not selected. The modify feature control now listens for beforefeatureselected and triggers beforefeaturemodified. If a listener returns false, feature modification never begins. r=elemione,ahocevar (closes #1427)

Note: See TracTickets for help on using tickets.