Skip to content
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

Fix horizontal alignment of colorbar in editable mode when xanchor is set to center #6002

Merged
merged 2 commits into from
Oct 26, 2021

Conversation

archmoj
Copy link
Contributor

@archmoj archmoj commented Oct 26, 2021

Fixes #6001 | Before vs After.

cc: @plotly/plotly_js

@archmoj archmoj added the bug something broken label Oct 26, 2021
@archmoj archmoj added this to the v2.6.0 milestone Oct 26, 2021
@@ -208,7 +208,7 @@ function drawColorBar(g, opts, gd) {
// then fix at the end (since we don't know the width yet)
var xLeft = Math.round(opts.x * gs.w + opts.xpad);
// for dragging... this is getting a little muddled...
var xLeftFrac = opts.x - thickFrac * ({middle: 0.5, right: 1}[opts.xanchor] || 0);
var xLeftFrac = opts.x - thickFrac * ({center: 0.5, right: 1}[opts.xanchor] || 0);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is no "middle" key for the xanchor : )

@archmoj archmoj merged commit 30f3c72 into master Oct 26, 2021
@archmoj archmoj deleted the colorbar-xanchor-center branch October 26, 2021 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

Successfully merging this pull request may close these issues.

problem editing position of colorbar when xanchor is set to center
1 participant