all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Zero height line causing arithmetic errors
@ 2008-06-14 17:35 Stefan Monnier
  2008-06-19  1:12 ` Kenichi Handa
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Monnier @ 2008-06-14 17:35 UTC (permalink / raw)
  To: emacs-devel


My MPC.el package uses an overlay placed at the end of a line with an
after-string of #("\n" 0 1 (face (:height 0.05 :inverse-video t)))
in order to place a horizontal line in the display.

In Emacs-22, this worked fine (except the line was a bit thicker than
0.05 times the base line height).  In Emacs-CVS until recently this
worked except that the line was full-height (i.e. 13 pixels in my case).
Recently, it has started to cause more problems because now
FRAME_SMALLEST_FONT_HEIGHT returns 0, and that value is used at 2 places
in the divisor position.

I guess the 0 is because 13 pixels (default font height) * 0.05 -> 0.65
pixels which are truncated to 0.

I currently use the patch below, which makes it all work again (tho
still with the problem that the 0.05 isn't taken into account and line
line is 13 pixel think), but I suspect it's not the right place to fix
it,


        Stefan


=== modified file 'src/font.c'
--- src/font.c	2008-06-13 16:25:44 +0000
+++ src/font.c	2008-06-14 17:30:14 +0000
@@ -2682,6 +2682,7 @@
       if (FRAME_SMALLEST_FONT_HEIGHT (f) > font->height)
 	FRAME_SMALLEST_FONT_HEIGHT (f) = font->height, fonts_changed_p = 1;
     }
+  FRAME_SMALLEST_FONT_HEIGHT (f) = max (1, FRAME_SMALLEST_FONT_HEIGHT (f));
 #endif
 
   return font_object;





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

end of thread, other threads:[~2008-06-19 14:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-14 17:35 Zero height line causing arithmetic errors Stefan Monnier
2008-06-19  1:12 ` Kenichi Handa
2008-06-19  1:19   ` Dan Nicolaescu
2008-06-19 14:13   ` Stefan Monnier

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.