-
Notifications
You must be signed in to change notification settings - Fork 50
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
Ruler guides are broken in GEF 3.19.0.202402212051 #418
Comments
@wiresketch first of all I totally understand your concern and I'm also not happy about the situation. I'm really trying my best to not produce situations like the one you found now twice. On the other hand we have the situation that GEF Classic has a lot of dangerous code that can lead in special situation to severe issues. Also we have performance issues and would like to get new features in (e.g., #261). That is one of the reasons I spend my time on cleaning the code. Coming back to the problem you found. After looking at the code I strongly belive that RulerLayout should never have inherited from XYLayout. If you agree I would change that to AbstractLayout as you suggest and fix the problems we have here. |
@azoitl I agree that making RulerLayout extend AbstractLayout is a better solution. I gave it a try below to see what methods would need to be brought from XYLayout into RulerLayout to ensure that the behavior does not change. Feel free to use this code.
|
Thx this helps. I tried and in my RCP this solves the problem. I would have two questions where I would be happy to get feedback:
|
|
ad 1) you have a good point here. Will follow that. |
A few cents from my side:
An more generally, how difficult do you two think it would be to create a small ruler example? It's apparently used in the Logic example, but I have yet to figure out how to make it show up exactly. I think a large part of this problem is caused by our abysmal test coverage. So whenever such regressions do show up, I'd like to include a reproducer it to our automatic tests. |
…ef#418 RulerLayout inherited from XYLayout. The later assumed that children constraint are rectangles. As this is not valid for RulerLayouts the RulerLayout was changed to inherit from AstractLayout and use its own constraint map with Integers. Fixes eclipse-gef#418
That seems for me even better.
I totally agree. And I'm really bad at testing. I fear the ruler would need a full fledged GEF Classic editor to be tested. Waht I can try is to see how we get the ruler shown in the Logic editor. Which I think would anyhow be a good idea. |
@ptziegler From the looks of it the logic example should have a menu entry for toggling the ruler visibility. |
There I wouldn't have searched for it. |
…ef#418 RulerLayout inherited from XYLayout. The later assumed that children constraint are rectangles. As this is not valid for RulerLayouts the RulerLayout was changed to inherit from AstractLayout and use its own constraint map with Integers. Fixes eclipse-gef#418
…ef#418 RulerLayout inherited from XYLayout. The later assumed that children constraint are rectangles. As this is not valid for RulerLayouts the RulerLayout was changed to inherit from AstractLayout and use its own constraint map with Integers. Fixes eclipse-gef#418
RulerLayout inherited from XYLayout. The later assumed that children constraint are rectangles. As this is not valid for RulerLayouts the RulerLayout was changed to inherit from AstractLayout and use its own constraint map with Integers. Fixes #418
Check whether Rectangle/Integer are valid constraints and whether an error is thrown if absent. See eclipse-gef#418
Check whether Rectangle/Integer are valid constraints and whether an error is thrown if the contract is violated.. See eclipse-gef#418
Check whether Rectangle/Integer are valid constraints and whether an error is thrown if the contract is violated. See eclipse-gef#418
Check whether Rectangle/Integer are valid constraints and whether an error is thrown if the contract is violated. See eclipse-gef#418
Check whether Rectangle/Integer are valid constraints and whether an error is thrown if the contract is violated. See eclipse-gef#418
Check whether Rectangle/Integer are valid constraints and whether an error is thrown if the contract is violated. See #418
When using ruler guides the following exception is constantly being logged and ruler guides do not work:
The issue is introduced in commit 4635985 from Dec 30, 2023 which apparently only modernizes code, but breaks the ruler functionality. The problem is with the change in XYLayout where constraints are forced to be Rectangles. Since setConstraint method takes an object the change adds an instanceof check and silently rejects all other types of constraints:
Previously this method looked like this:
This change breaks RulerLayout class which is a subclass of XYLayout and which uses Integer constraints instead of Rectangle.
This issue is really critical since I couldn't not find a way to add a workaround in my app. The fix could either revert this change, or perhaps make RulerLayout inherit directly from AbstractLayout to remove the dependency on XYLayout.
I am really worried about all this changes lately. Code modernization is nice, but doing it just for the sake of it feels unnecessary to me. On the other hand this is the second breaking change I find, and this just in the code I use, so this trend really worries me.
The text was updated successfully, but these errors were encountered: