[Mono-dev] System.Drawing.Graphics.MeasureCharacterRanges broken with empty layout rectangle

Stefanos A. stapostol at gmail.com
Thu Nov 27 09:27:48 EST 2008


When MeasureCharacterRanges is passed an empty layout rectangle
(RectangleF.Empty), it should not perform any word wrapping. Attached is
a test case that demonstrates the issue (runs fine under .Net).

Compile with "gmcs Program.cs -r:System.Drawing.dll".

Expected output:

$ mono Program.exe 
Using rectangle {X=0,Y=0,Width=100,Height=100}:
{X=0,Y=0,Width=9,Height=18}
{X=9,Y=0,Width=9,Height=18}
{X=18,Y=0,Width=8,Height=18}

Using rectangle {X=0,Y=0,Width=0,Height=0}:
{X=0,Y=0,Width=9,Height=18}
{X=9,Y=0,Width=9,Height=18}
{X=18,Y=0,Width=8,Height=18}


Observed output:

$ mono Program.exe 
Using rectangle {X=0,Y=0,Width=100,Height=100}:
{X=0,Y=0,Width=9,Height=18}
{X=9,Y=0,Width=9,Height=18}
{X=18,Y=0,Width=8,Height=18}

Using rectangle {X=0,Y=0,Width=0,Height=0}:
{X=-4194304,Y=-4194304,Width=8388608,Height=8388608}
{X=-4194304,Y=-4194304,Width=8388608,Height=8388608}
{X=-4194304,Y=-4194304,Width=8388608,Height=8388608}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Program.cs
Type: text/x-csharp
Size: 1331 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20081127/5a432d14/attachment-0001.bin 


More information about the Mono-devel-list mailing list