bitstormFA / jlatexmathfx

A Javafx Control to render LaTeX math formula
GNU General Public License v2.0
28 stars 10 forks source link

Is it possible to fix the position of a LateXMathSkin? #5

Closed spockoyno closed 6 years ago

spockoyno commented 6 years ago

When the parent panel of a LateX control is resized, the control's position relative to other widgets changes (and the look of the GUI is corrupted). This is due to the implementation of the "computePrefHeight(...)" and "computePrefWidth(...)" in the LateXMathSkin class. Is it possible to also provide an option to fix the position of a LateX control?

bitstormFA commented 6 years ago

should be fixed in 0.33

spockoyno commented 6 years ago

@bitstormGER Thank you for the new release and for incorporating my suggestions!

I'm afraid the current issue still remains. I probably didn't explain it properly - my fault. Below are the pictures.

There're 3 VBoxes, each with latex controls. Resizing the panel distorts the relative positions of the displays (especially in large GUIs with many panels.) The desired view obtains, eg, by replacing the last line, in 'LateXMathSkin', of protected double computePrefHeight(...) { ... return topInset + bottomInset + teXIcon.getIconHeight() * size; } with return rightInset + leftInset + teXIcon.getIconWidth() + iconWidthDelta, where iconWidthDelta >=0

The problem is that teXIcon is private. So could it be helpful to add protected double getIconHeight() and getIconWidth() to 'LateXMathSkin' to allow subclass implementations?

Desired view:

screen shot 2017-11-14 at 15 44 43

Current implementation:

screen shot 2017-11-14 at 15 48 42