[Balloon] [Bug+Fix] in BalloonCanvas>>drawString: ...

View: New views
4 Messages — Rating Filter:   Alert me  

[Balloon] [Bug+Fix] in BalloonCanvas>>drawString: ...

by Jens Lincke :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I found a bug in the BalloonCanvas when drawing a String with an offset
transformation

the method
drawString: s from: firstIndex to: lastIndex in: boundsRect font:
fontOrNil color: c
was marked TODO and did only draw when it can fall back to FormCanvas

But the offset in the Transformation was ignored, so I changed it into:

drawString: s from: firstIndex to: lastIndex in: boundsRect font:
fontOrNil color: c
   (self ifNoTransformWithIn: boundsRect)
       ifTrue:[ | offset |
       offset := transform a13 @ transform a23.

       ^super drawString: s from: firstIndex to: lastIndex in:
boundsRect + offset font: fontOrNil color: c]


and uploaded a iSqueak3.8 package Balloon-jl.4 to the
source.impara.de/Stuff

- Jens Lincke -

_______________________________________________
Balloon mailing list
Balloon@...
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/balloon

Re: [Balloon] [Bug+Fix] in BalloonCanvas>>drawString: ...

by Andreas Raab :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Can you email me the patch?

Thanks,
   - Andreas

Jens Lincke wrote:

> Hi,
>
> I found a bug in the BalloonCanvas when drawing a String with an offset
> transformation
>
> the method
> drawString: s from: firstIndex to: lastIndex in: boundsRect font:
> fontOrNil color: c
> was marked TODO and did only draw when it can fall back to FormCanvas
>
> But the offset in the Transformation was ignored, so I changed it into:
>
> drawString: s from: firstIndex to: lastIndex in: boundsRect font:
> fontOrNil color: c
>   (self ifNoTransformWithIn: boundsRect)
>       ifTrue:[ | offset |
>       offset := transform a13 @ transform a23.
>
>       ^super drawString: s from: firstIndex to: lastIndex in: boundsRect
> + offset font: fontOrNil color: c]
>
>
> and uploaded a iSqueak3.8 package Balloon-jl.4 to the
> source.impara.de/Stuff
>
> - Jens Lincke -
>
> _______________________________________________
> Balloon mailing list
> Balloon@...
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/balloon
>
_______________________________________________
Balloon mailing list
Balloon@...
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/balloon

Re: [Balloon] [Bug+Fix] in BalloonCanvas>>drawString: ...

by Jens Lincke :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

here is the changeset

Andreas Raab schrieb:

> Can you email me the patch?
>
> Thanks,
>   - Andreas
>
> Jens Lincke wrote:
>> Hi,
>>
>> I found a bug in the BalloonCanvas when drawing a String with an
>> offset transformation
>>
>> the method
>> drawString: s from: firstIndex to: lastIndex in: boundsRect font:
>> fontOrNil color: c
>> was marked TODO and did only draw when it can fall back to FormCanvas
>>
>> But the offset in the Transformation was ignored, so I changed it into:
>>
>> drawString: s from: firstIndex to: lastIndex in: boundsRect font:
>> fontOrNil color: c
>>   (self ifNoTransformWithIn: boundsRect)
>>       ifTrue:[ | offset |
>>       offset := transform a13 @ transform a23.
>>
>>       ^super drawString: s from: firstIndex to: lastIndex in:
>> boundsRect + offset font: fontOrNil color: c]
>>
>>
>> and uploaded a iSqueak3.8 package Balloon-jl.4 to the
>> source.impara.de/Stuff
>>
>> - Jens Lincke -
>>
>> _______________________________________________
>> Balloon mailing list
>> Balloon@...
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/balloon
>>


_______________________________________________
Balloon mailing list
Balloon@...
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/balloon

Balloon-Fix-drawString-offset.1.cs.gz (422 bytes) Download Attachment

Re: [Balloon] [Bug+Fix] in BalloonCanvas>>drawString: ...

by Jens Lincke :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I added drawing of a red rectangle, to show that there is something that
can not be drawn
in the second change set. It would be better to actually fix this
method, but I think, for that we now have Rome...

Jens Lincke schrieb:

> here is the changeset
>
> Andreas Raab schrieb:
>> Can you email me the patch?
>>
>> Thanks,
>>   - Andreas
>>
>> Jens Lincke wrote:
>>> Hi,
>>>
>>> I found a bug in the BalloonCanvas when drawing a String with an
>>> offset transformation
>>>
>>> the method
>>> drawString: s from: firstIndex to: lastIndex in: boundsRect font:
>>> fontOrNil color: c
>>> was marked TODO and did only draw when it can fall back to FormCanvas
>>>
>>> But the offset in the Transformation was ignored, so I changed it into:
>>>
>>> drawString: s from: firstIndex to: lastIndex in: boundsRect font:
>>> fontOrNil color: c
>>>   (self ifNoTransformWithIn: boundsRect)
>>>       ifTrue:[ | offset |
>>>       offset := transform a13 @ transform a23.
>>>
>>>       ^super drawString: s from: firstIndex to: lastIndex in:
>>> boundsRect + offset font: fontOrNil color: c]
>>>
>>>
>>> and uploaded a iSqueak3.8 package Balloon-jl.4 to the
>>> source.impara.de/Stuff
>>>
>>> - Jens Lincke -
>>>
>>> _______________________________________________
>>> Balloon mailing list
>>> Balloon@...
>>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/balloon
>>>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Balloon mailing list
> Balloon@...
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/balloon
>  


_______________________________________________
Balloon mailing list
Balloon@...
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/balloon

Balloon-Fix-drawString-offset.2.cs.gz (570 bytes) Download Attachment