help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Calculate window size in pixels


From: Mathias Dahl
Subject: Re: Calculate window size in pixels
Date: 07 May 2005 19:51:11 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

Kevin Rodgers <address@hidden> writes:

> Mathias Dahl wrote:
> > (defun window-height-pixels ()
> >   (let ((line-pixel-height-ratio (/ (+ (frame-pixel-height) 0.0) 
> > (frame-height))))
> >     (truncate (* (window-height) line-pixel-height-ratio))))
> > (defun window-width-pixels ()
> >   (let ((column-pixel-width-ratio (/ (+ (frame-pixel-width) 0.0) 
> > (frame-width))))
> >     (truncate (* (window-width) column-pixel-width-ratio))))
> 
> I think (+ (frame-pixel-DIMENSION) 0.0) can be replaced by
> (float (frame-pixel-DIMENSION))

It can :), thanks! Looks better.

/Mathias


reply via email to

[Prev in Thread] Current Thread [Next in Thread]