Skip to content

Apply and ensure stroke event only to activate editable shapes #4810

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 4, 2020

Conversation

archmoj
Copy link
Contributor

@archmoj archmoj commented May 4, 2020

Fixes #4806 and fixes #4808 also now one could strat drawing over shapes no matter what the opacity of the below shape is.

Codepen after: https://codepen.io/MojtabaSamimi/pen/WNQdQZv

@plotly/plotly_js
@emmanuelle

@archmoj archmoj added bug something broken status: reviewable regression this used to work labels May 4, 2020
@archmoj archmoj added this to the v1.54.1 milestone May 4, 2020
@@ -163,15 +168,11 @@ function drawOne(gd, index) {
} else {
if(gd._context.edits.shapePosition) {
setupDragElement(gd, path, options, index, shapeLayer, editHelpers);
} else {
if(options.editable === true) {
path.style('pointer-events', 'stroke');
Copy link
Collaborator

Choose a reason for hiding this comment

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

As long as this is scoped to options.editable === true, can't we still allow clicking on the fill when it's mostly opaque? >0.5 seems a fine cutoff to me. I feel like that's the behavior people will expect - most importantly when there's no stroke but even when there is as long as there's a strong fill.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Revised in 078c007.

}
}
]
}, onfig: {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
}, onfig: {
}, config: {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

typo of the week

Copy link
Collaborator

@alexcjohnson alexcjohnson left a comment

Choose a reason for hiding this comment

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

Fantastic! Just one little typo to fix and this should be ready! 💃

@archmoj archmoj merged commit 9112759 into master May 4, 2020
@archmoj archmoj deleted the fix4808-shape-pointer-events branch May 4, 2020 21:08
@nicolaskruchten
Copy link
Contributor

@archmoj re:

now one could strat drawing over shapes no matter what the opacity of the below shape is.

do we need to change one of the schema attribute descriptions to match this? I can't remember.

@archmoj
Copy link
Contributor Author

archmoj commented May 5, 2020

@archmoj re:

now one could strat drawing over shapes no matter what the opacity of the below shape is.

do we need to change one of the schema attribute descriptions to match this? I can't remember.

@nicolaskruchten
No. It was before applying 078c007
in respect to @alexcjohnson's #4810 (comment).
The PR description is modified above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken regression this used to work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can no longer pan/zoom when mousedown is on shapes Shapes on below layer hides hover labels on 1.54.0
3 participants