[Libreoffice] Rectangle width

Dmitry. A. Ashkadov dmitry.ashkadov at gmail.com
Tue Aug 23 02:23:19 PDT 2011


Hello!

For example, there is small bug corresponding to this problem. See 
function «ImplDrawDropdownArrow» in «toolbox.cxx» («vcl» module).
A lines
     long x = rDropDownRect.Left() + (rDropDownRect.getWidth() - width)/2;
     long y = rDropDownRect.Top() + (rDropDownRect.getHeight() - height)/2;

use wrong functions getHeight() and getWidth() , but really should use 
GetHeight() and GetWidth().
So, this problem causes the dropdown arrows of menubuttons on toolboxes 
to be shifted left.

Shifted left dropdown arrow

18.08.2011 13:21, Michael Meeks пишет:
> On Wed, 2011-08-17 at 23:08 +0200, Thorsten Behrens wrote:
>> Hi Dmitry - yes, the two different methods are surely confusing. As
>> for the "wrong value", that very much depends on the mental model of
>> rectangles you're using. In a discrete geometry world (aka "pixel"),
>> the GetWidth() is correct. In a continuous geometry world (aka
>> "euclidean plane"), getWidth() is right.
> 	Ho ;-) Should we perhaps have some better naming: 'getOuterWidth' vs.
> 'getWidth' or something ;-)
>
>> This fundamental, conceptual difference is the historical reason for
>> the two methods (admittedly, not a very clean solution to the
>> problem).
> 	True - perhaps we should audit all calls of GetWidth on Rectangle to
> see how many there are and update them if fewer than a couple of hundred
> or so ?
>
> 	ATB,
>
> 		Michael.
>


-- 
Best Regards,
     Dmitry

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20110823/a2cf16dc/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ddarrow.png
Type: image/png
Size: 7358 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20110823/a2cf16dc/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dmitry_ashkadov.vcf
Type: text/x-vcard
Size: 155 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20110823/a2cf16dc/attachment-0001.vcf>


More information about the LibreOffice mailing list