Set a fixed bond length to reduce jumping when adding atoms#34
Set a fixed bond length to reduce jumping when adding atoms#34jacktday wants to merge 2 commits intoEBjerrum:masterfrom
Conversation
|
This now prevents any jumping, but disables auto scaling. I could manually add auto scaling or a way of panning and zooming could be added to the UI. I think the later is a better solution |
|
Thanks a lot for all you pull request! Unfortunately I'm super busy these final days before Christmas, but hopefully I will find the time to look at them soon |
|
I think this pull-request is not completely there. I think the setting of a fixedbondlength is great, as it keeps the initial molecule decent in size and similar in size. However, if we manually fix the scale we disable the autoscaling as you already mention. RDKits autoscaling is already a nice solution to the problem of the molecules getting too big and seem to then downscale the bondsize when the molecule can't fit the canvas. (fixedBondSize should maybe have been named maxBondSize???), and we then also must take over the panning and zooming ourselves (middle-click and drag, and scroll wheel could probably be used), alternatively check if drawatoms are outside the canvas and adjust the bond-length accordingly. This opens a lot of complexity, where the autoscaling from RDKit already fixed that. I've always said that rdEditor is a molecular editor and not a drawing tool, as we then circumvent the canvas concept and offload all layout and rendering to RDKit, thus getting the tool a bit more simple. (It has developed in the more complex direction anyway though, lol). |
This reduces jumping when adding atoms by reducing the need to resize the screen. This could be further improved by preventing the renderer from centering the molecule. Centering should already be turned off, there is likely some other setting that needs to be changed.