Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Text property, 'extent', not working properly
Date: Sun, 19 Jul 2009 15:43:01 +0000 (UTC)
Organization: Georgia Institute of Technology
Lines: 5
Message-ID: <h3veu5$739$1@fred.mathworks.com>
References: <h3slb9$nsa$1@fred.mathworks.com> <h3t9g9$fe2$1@fred.mathworks.com> <h3tt69$e99$1@fred.mathworks.com> <h3u041$lov$1@fred.mathworks.com> <h3v2ih$6h1$1@fred.mathworks.com> <h3v5pm$6sa$1@fred.mathworks.com> <h3v8t2$rl$1@fred.mathworks.com> <h3vbuh$jle$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1248018181 7273 172.30.248.35 (19 Jul 2009 15:43:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 19 Jul 2009 15:43:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 939004
Xref: news.mathworks.com comp.soft-sys.matlab:556622




I think it is a quantization thing. For whatever reason it seems the value of extent is rounded to 0.2. (This might be true of all position properties, I can't remember ever seeing better precision than that... but i could be wrong) Assuming your get(0,'screenpixelsperinch') is 96, one point is 96/72=4/3 pixels. Thus 24 points is 32 pixels, but 25 points is 33.333 pixels, which when rounded the nearest .2 is gonna give some error. 

But what is the problem you're trying to solve here? I've always just found it more annoying to have positions that are not rounded to the nearest pixel (since that's how they appear on screen). Is there any reason you can't just work in pixel units and avoid this problem entirely? Do you really need sub-pixel resolution in your answers?