unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#67563: 30.0.50; Box should not extend with line-spacing
@ 2023-12-01  7:47 Yuan Fu
  2023-12-02 14:06 ` Eli Zaretskii
  0 siblings, 1 reply; 3+ messages in thread
From: Yuan Fu @ 2023-12-01  7:47 UTC (permalink / raw)
  To: 67563

[-- Attachment #1: Type: text/plain, Size: 815 bytes --]

If I set a box face for a button, and then set a line-space for the buffer, I expect the extra space between lines to be added outside of the box, like so:

+-------------------------+
|          Box            |
|                         |
+-------------------------+
       extra line space
+-------------------------+
|          Box            |
|                         |
+-------------------------+

However, right now, the bottom line of the box includes the extra line spacing, like so:

+-------------------------+
|          Box            |
|                         |
+                         +
|      extra line space   |
+-------------------------+
+-------------------------+
|          Box            |
|                         |
+-------------------------+

Screenshot:

[-- Attachment #2: Screenshot 2023-11-30 at 11.44.53 PM.png --]
[-- Type: image/png, Size: 12218 bytes --]

[-- Attachment #3: Type: text/plain, Size: 279 bytes --]


Ideally there should be some space between the two buttons on the two lines. Also notice the extra space above the bottom line of the box.

I also attached a repo file to produce these buttons.

If someone can give me some pointers, I can try to look into this.

Yuan


[-- Attachment #4: repo.el --]
[-- Type: application/octet-stream, Size: 325 bytes --]

(let ((button (propertize "Button"
                          'face '( :box (:line-width 3 :color "blue")
                                   :background "gray92"))))
  (switch-to-buffer "*test*")
  (erase-buffer)
  (setq-local line-spacing 0.2)
  (insert "\n" button " text text" button "\n"
          button " text text\n"))

[-- Attachment #5: Type: text/plain, Size: 2 bytes --]




^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#67563: 30.0.50; Box should not extend with line-spacing
  2023-12-01  7:47 bug#67563: 30.0.50; Box should not extend with line-spacing Yuan Fu
@ 2023-12-02 14:06 ` Eli Zaretskii
  2023-12-04  8:23   ` Yuan Fu
  0 siblings, 1 reply; 3+ messages in thread
From: Eli Zaretskii @ 2023-12-02 14:06 UTC (permalink / raw)
  To: Yuan Fu; +Cc: 67563

> From: Yuan Fu <casouri@gmail.com>
> Date: Thu, 30 Nov 2023 23:47:37 -0800
> 
> If I set a box face for a button, and then set a line-space for the buffer, I expect the extra space between lines to be added outside of the box, like so:
> 
> +-------------------------+
> |          Box            |
> |                         |
> +-------------------------+
>        extra line space
> +-------------------------+
> |          Box            |
> |                         |
> +-------------------------+
> 
> However, right now, the bottom line of the box includes the extra line spacing, like so:
> 
> +-------------------------+
> |          Box            |
> |                         |
> +                         +
> |      extra line space   |
> +-------------------------+
> +-------------------------+
> |          Box            |
> |                         |
> +-------------------------+
> 
> Screenshot:
> 
> Ideally there should be some space between the two buttons on the two lines. Also notice the extra space above the bottom line of the box.
> 
> I also attached a repo file to produce these buttons.
> 
> If someone can give me some pointers, I can try to look into this.

We currently draw the box such that its height is equal to the height
of the screen line, and that includes line-spacing.

The implementation is in x_draw_glyph_string_box and similar functions
in other GUI backends (w32_draw_glyph_string_box etc.).

If you want to ad a feature where the box excludes line-space, please
make it optional, by default off, as the current behavior is a very
old one.





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#67563: 30.0.50; Box should not extend with line-spacing
  2023-12-02 14:06 ` Eli Zaretskii
@ 2023-12-04  8:23   ` Yuan Fu
  0 siblings, 0 replies; 3+ messages in thread
From: Yuan Fu @ 2023-12-04  8:23 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 67563



On 12/2/23 6:06 AM, Eli Zaretskii wrote:
>> From: Yuan Fu <casouri@gmail.com>
>> Date: Thu, 30 Nov 2023 23:47:37 -0800
>>
>> If I set a box face for a button, and then set a line-space for the buffer, I expect the extra space between lines to be added outside of the box, like so:
>>
>> +-------------------------+
>> |          Box            |
>> |                         |
>> +-------------------------+
>>         extra line space
>> +-------------------------+
>> |          Box            |
>> |                         |
>> +-------------------------+
>>
>> However, right now, the bottom line of the box includes the extra line spacing, like so:
>>
>> +-------------------------+
>> |          Box            |
>> |                         |
>> +                         +
>> |      extra line space   |
>> +-------------------------+
>> +-------------------------+
>> |          Box            |
>> |                         |
>> +-------------------------+
>>
>> Screenshot:
>>
>> Ideally there should be some space between the two buttons on the two lines. Also notice the extra space above the bottom line of the box.
>>
>> I also attached a repo file to produce these buttons.
>>
>> If someone can give me some pointers, I can try to look into this.
> We currently draw the box such that its height is equal to the height
> of the screen line, and that includes line-spacing.
>
> The implementation is in x_draw_glyph_string_box and similar functions
> in other GUI backends (w32_draw_glyph_string_box etc.).
Thanks, I'll come back when I have good questions to ask.
> If you want to ad a feature where the box excludes line-space, please
> make it optional, by default off, as the current behavior is a very
> old one.
Will do. I'm sure the current behavior has its use-cases too.

Yuan





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-12-04  8:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-01  7:47 bug#67563: 30.0.50; Box should not extend with line-spacing Yuan Fu
2023-12-02 14:06 ` Eli Zaretskii
2023-12-04  8:23   ` Yuan Fu

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).