Ticket #3319 (closed bug: duplicate)

Opened 2 years ago

Last modified 14 months ago

Handler.Path: Problem with "modify" callback in drawing parameter.

Reported by: jorix Owned by: tschaub
Priority: trivial Milestone: 2.13 Release
Component: Handler.Path Version: 2.11 RC1
Keywords: Cc:
State:

Description

There is a problem with "modify" callback in drawing parameter using freehand (in down and move methods)

Starting freehand, and continuing in normal mode all the moves before the next point call "modify" callback with the drawing parameter to false.

Try:

  • use the example measure.html selecting "use immediate measures"
  • start freehand
  • release the shift key
  • move, oops! the immediate measure does not change.
  • continue freehand
  • release the shift key
  • move, ok! now works

Attachments

3319-A1.patch Download (13.4 KB) - added by jorix 23 months ago.
A: using new drawing property
3319-B1.patch Download (13.3 KB) - added by jorix 23 months ago.
B: using getCurrentPointIndex function
3319-A2.patch Download (13.4 KB) - added by jorix 21 months ago.
Merged with current trunk

Change History

in reply to: ↑ description   Changed 2 years ago by jorix

Replying to jorix:

...

missing a step:

  • ...
  • move, oops! the immediate measure does not change.
  • click
  • continue freehand
  • ...

  Changed 2 years ago by jorix

  • summary changed from Handler.Path: Problem with modify callback in drawing parameter. to Handler.Path: Problem with "modify" callback in drawing parameter.

  Changed 2 years ago by crschmidt

  • milestone changed from 2.11 Release to 2.12 Release

  Changed 2 years ago by crschmidt

  • milestone changed from 2.12 Release to 2.11 Release

follow-up: ↓ 6   Changed 2 years ago by pgiraud

  • milestone changed from 2.11 Release to 2.12 Release

I would not consider this one blocker for 2.11 since the "immediate measure" option was not available in 2.10. Please shout out if you don't agree.

in reply to: ↑ 5   Changed 2 years ago by jorix

Replying to pgiraud:

I would not consider this one blocker for 2.11 since the "immediate measure" option was not available in 2.10. Please shout out if you don't agree.

The behavior is not consistent. first time not works and the next really works, oops!

To write a patch is very easy using  3323.patch (now rejected by you), only needs to be changed !!this.lastUp by this.drawing in down and move methods. I convinced "crschmidt" using this argument ( 3323#comment:4).

Sorry I did not publish the patch, waiting for the implementation of #3323 (thought I'd have to give less explanation, I was wrong) :-(

You have the last word. I do not touch more this ticket if the OL team does not seem appropriate.

Changed 23 months ago by jorix

A: using new drawing property

Changed 23 months ago by jorix

B: using getCurrentPointIndex function

  Changed 23 months ago by jorix

  • state set to Review
  • milestone changed from 2.12 Release to 2.11 Release

I've looked again this topic:

There is an added difficulty: The use of third argument of modify callback isn't described in the documentation (also not mentioned in the release notes)

I think interesting to add such documentation in 2.11, since it is an improvement that avoids having to use drawing property of the handler (which has disappeared in 2.11)

When addPoint I have retained the undefined value for drawing argument, it is more pactice see use in Control/Measure.js.

To fix the bug, I propose two alternatives:

  • A: use the drawing property reintroduced (only for internal use)
  • B: use the new getCurrentPointIndex function (I think it will cost a bit more)

In the two options are added detailed documentation and tests of drawing argument of modify callback (only three of new tests fail using the trunk)

NOTE: I have not touched the line 480 of Handler/Path.js but I think it should be this.modifyFeature(evt.xy, !!this.lastUp); I have not changed because currently does not cause problems (that I know)

  Changed 22 months ago by bartvde

  • milestone changed from 2.11 Release to 2.12 Release

After discussion with crschmidt on IRC moving to 2.12

Changed 21 months ago by jorix

Merged with current trunk

  Changed 21 months ago by jorix

The bug is still active, please review: 3319-A2.patch Download or 3319-B1.patch Download. Thanks

  Changed 16 months ago by jorix

  Changed 14 months ago by jorix

  • status changed from new to closed
  • state Review deleted
  • resolution set to duplicate

follow on GitHub

Note: See TracTickets for help on using tickets.