-
Notifications
You must be signed in to change notification settings - Fork 31
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 labels around border #616
base: master
Are you sure you want to change the base?
Conversation
@@ -1294,6 +1294,7 @@ def draw_labels(self, panel, page): | |||
y = panel['y'] | |||
width = panel['width'] | |||
height = panel['height'] | |||
border = panel['border'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better to use border = panel.get('border')
which won't cause an error if border is missing
The app JS fix looks good. The PDF labels are shifted OK for single labels in some positions, but where we have multiple labels (e.g top right panel) or labels on the inside corners then it's not looking right. Screenshot shows app (top-left), PDF with this PR (top-right) and PDF without this PR (bottom). All borders are 15 px: |
Hello Will, Thanks for you careful review. I've made a fix to correct that. There is only one remaining thing. When you re-open the figure, with vertical labels on panel with borders, the vertical labels are very far away from the panel. If you move the panel, then the position of the labels are correctly updated. I found out that this behavior is coming from those two lines
If I remove them, this behavior disappear. But I don't know if I'm allowed to remove them, as they should be needed for something, right ? Rémy. |
OK, so this took me quite a bit of digging... You do need those I also noticed that if you simply toggle the border (hide then show) then it fixes the issue, which turns out that simply calling Then I tried adding an extra call to It turns out that the first time that If I update the code to avoid calling With that change, it also turns out that we don't need Give this a try!
|
Hi @will-moore Indeed, it's a deep review you did here, thanks for your time ! Thanks again for finding the solution, |
Conflicting PR. Removed from build OMERO-plugins-push#345. See the console output for more details.
--conflicts |
self.render_shapes(); | ||
}, 10); | ||
this.render_scalebar(); // also calls render_layout() -> render_labels() | ||
this.render_shapes(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the conflict with #605 is coming from here
Conflicting PR. Removed from build OMERO-plugins-push#346. See the console output for more details.
--conflicts |
Conflicting PR. Removed from build OMERO-plugins-push#347. See the console output for more details.
--conflicts |
Resolves #614, resolves #615