Skip to content

Conversation

@bjornharrtell
Copy link
Contributor

This PR changes the current behaviour of Modify interaction in that it will create a vertex when single clicking a boundary and raise revision by 1.

Previously, single clicking a boundary would create a vertex but immediately delete it resulting in unmodified geometry but with revision raised by 2.

@bjornharrtell bjornharrtell changed the title Create vertex on single click Create vertex on boundary single click Apr 27, 2015
@bjornharrtell
Copy link
Contributor Author

Ready for review. Ping @tschaub.

@bjornharrtell
Copy link
Contributor Author

Rebased on 3.5.0 master to keep this ready for review.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be initialized to [NaN, NaN].

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or maybe this.lastNewVertexPixel_ = null?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Though I think that would break the checks below, right?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only noticed the checks below after I send my comment. You are right, [NaN, NaN] is cleaner because you don't have to do an additional check (goog.isNull).

@tschaub
Copy link
Member

tschaub commented May 7, 2015

This looks like a nice solution @bjornharrtell. What do you think about clearing the lastNewVertexPixel_ on pointermove? This would presumably allow someone to add a vertex and then delete it again (though I haven't confirmed that this doesn't work with your change).

@bjornharrtell
Copy link
Contributor Author

Thanks for the review. Changed to initialize with NaN. Clearing lastNewVertexPixel_ in handlePointerMove_ does not seem to affect behaviour or test case outcome. I think the behaviour is as you describe already, if I'm not misunderstanding.

@ghost ghost mentioned this pull request May 21, 2015
@bjornharrtell
Copy link
Contributor Author

With #3461 now merged I think this change is even more important so I've rebased this on master.

@bartvde bartvde added this to the v3.7.0 milestone Jul 3, 2015
@bartvde
Copy link
Member

bartvde commented Jul 3, 2015

LGTM

bartvde added a commit that referenced this pull request Jul 3, 2015
@bartvde bartvde merged commit 96eaf2d into openlayers:master Jul 3, 2015
@probins
Copy link
Contributor

probins commented Jul 3, 2015

I about to suggest this change for linestrings, but it looks like this PR also handles lines. I was misled by the title referring to 'boundaries'.

@oterral oterral mentioned this pull request Jul 3, 2015
41 tasks
@bjornharrtell bjornharrtell deleted the modify-singleclick-vertex branch July 5, 2015 11:17
@Turbo87
Copy link
Contributor

Turbo87 commented Jul 28, 2015

@bjornharrtell could you maybe have a look into #3935? it seems to be related to this change.

@bjornharrtell
Copy link
Contributor Author

I haven't been able to understand the connection between this PR and #3935, admittedly without putting any real time into it, but I'll look at rebasing this when it's in.

@bjornharrtell
Copy link
Contributor Author

Ehm, seems I forgot that this PR is actually merged for quite some time :)

@Turbo87
Copy link
Contributor

Turbo87 commented Aug 3, 2015

@bjornharrtell my proposed fix for #3935 is in #3946. feel free to review.

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.

6 participants