[LyX/master] Remove space between button and text with inlines collapsible insets
Scott Kostyshak
skostysh at lyx.org
Thu Feb 16 03:40:03 UTC 2023
On Sat, Feb 11, 2023 at 12:03:12PM -0500, Scott Kostyshak wrote:
> On Fri, Feb 10, 2023 at 07:49:46AM +0100, Daniel wrote:
> > On 2023-02-10 05:24, Scott Kostyshak wrote:
> > > On Mon, Feb 06, 2023 at 07:34:38PM +0100, Jean-Marc Lasgouttes wrote:
> > > > commit 04ece4f0d6af818b3bc572b558181b947a109580
> > > > Author: Jean-Marc Lasgouttes <lasgouttes at lyx.org>
> > > > Date: Sun Dec 11 20:59:43 2022 +0100
> > > >
> > > > Remove space between button and text with inlines collapsible insets
> > > > Typically there are two sources of spacing:
> > > > * the button has two pixels added to the left and to the right
> > > > * the frame around the text also has 2 pixels to the left and to the right
> > > > Note that this value of two pixels is given here for simplicity, but
> > > > these are parameterized by methods like textOffset or leftOffset.
> > > > What we want to remove is the space after the button and the space
> > > > before the frame. This is done in 3 places
> > > > In dimensionCollapsed(), the extra space is removed from the dimension
> > > > after its computation
> > > > In metrics(), the space avoided before the frame is removed from width.
> > > > In draw, the whome text inset is drawn with a negative offset.
> > > > Fixes #12335.
> > >
> > > Does cursor position need to be adapted for some reason? I attach two
> > > screenshots. "bad.png" is a screenshot with this commit, and "good.png"
> > > is the screenshot with the commit before. The cursor position of
> > > "bad.png" seems to intersect the border (the real position is that it's
> > > at the last position inside the "On Slide" inset).
> > >
> > > I think the screenshots also show an improvement from this commit. i.e.,
> > > the space in-between "On Slide" and the rectangle is now gone. I think
> > > that looks nice now!
> >
> > My screenshot with beta2 which seems to have the patch applied looks quite
> > different.
>
> Indeed, your screenshot looks very nice. I wonder what is causing the difference.
Another git bisect lead me here. When I open the attached file, the
space between the two branch insets shortens if I move the cursor.
screenshot1.png is on open, and screenshot2.png is after a cursor
movement.
Similarly, if I zoom out such that both branch insets are seen, if I
copy them, and then do a return to the next line, and paste them, on
paste the space is wider and if I move the cursor, again the space
between the pasted insets narrows.
Can anyone reproduce that?
Scott
-------------- next part --------------
A non-text attachment was scrubbed...
Name: space-shortens.23.lyx
Type: application/x-lyx
Size: 2066 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20230215/a7feeef2/attachment-0001.lyx>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: screenshot1.png
Type: image/png
Size: 19525 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20230215/a7feeef2/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: screenshot2.png
Type: image/png
Size: 28542 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20230215/a7feeef2/attachment-0003.png>
More information about the lyx-devel
mailing list