Problem with TransformationMorph

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem with TransformationMorph

Lukas Renggli
I noticed a problem with transformation morphs and created a bug report:

  http://code.google.com/p/pharo/issues/detail?id=2207

The problem seems to be that the transformation morph creates a black
rectangle on the rotated clipping bounds. I does not only happen with
TextMorphs but also with (some) other morphs. I tried to convert the
TextMorph to a SketchMorph and the same happens there. I have no idea
how to fix that problem. I need a solution because eCompletion rotates
some text by 90, which is currently not possible.

| stringMorph transformationMorph |
stringMorph := 'vertical text' asMorph.
transformationMorph := TransformationMorph new asFlexOf: stringMorph.
transformationMorph angle: Float pi / 2.
transformationMorph position: 5@5.
transformationMorph openInWorld.

Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Problem with TransformationMorph

Stéphane Ducasse
lukas

did you check in the latest version of squeak because I saw some fixes about put Morph in TextMorph?
Also in Cuis 2.0 because I imagine that juan got the same transformation. Now it seems that he changed that.

Stef
On Mar 26, 2010, at 8:58 AM, Lukas Renggli wrote:

> I noticed a problem with transformation morphs and created a bug report:
>
>   http://code.google.com/p/pharo/issues/detail?id=2207
>
> The problem seems to be that the transformation morph creates a black
> rectangle on the rotated clipping bounds. I does not only happen with
> TextMorphs but also with (some) other morphs. I tried to convert the
> TextMorph to a SketchMorph and the same happens there. I have no idea
> how to fix that problem. I need a solution because eCompletion rotates
> some text by 90, which is currently not possible.
>
> | stringMorph transformationMorph |
> stringMorph := 'vertical text' asMorph.
> transformationMorph := TransformationMorph new asFlexOf: stringMorph.
> transformationMorph angle: Float pi / 2.
> transformationMorph position: 5@5.
> transformationMorph openInWorld.
>
> Lukas
>
> --
> Lukas Renggli
> http://www.lukas-renggli.ch
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Problem with TransformationMorph

Lukas Renggli
Yeah, it is the same bug in Pharo 1.0 and 1.1

Lukas

On 26 March 2010 09:31, Stéphane Ducasse <[hidden email]> wrote:

> lukas
>
> did you check in the latest version of squeak because I saw some fixes about put Morph in TextMorph?
> Also in Cuis 2.0 because I imagine that juan got the same transformation. Now it seems that he changed that.
>
> Stef
> On Mar 26, 2010, at 8:58 AM, Lukas Renggli wrote:
>
>> I noticed a problem with transformation morphs and created a bug report:
>>
>>   http://code.google.com/p/pharo/issues/detail?id=2207
>>
>> The problem seems to be that the transformation morph creates a black
>> rectangle on the rotated clipping bounds. I does not only happen with
>> TextMorphs but also with (some) other morphs. I tried to convert the
>> TextMorph to a SketchMorph and the same happens there. I have no idea
>> how to fix that problem. I need a solution because eCompletion rotates
>> some text by 90, which is currently not possible.
>>
>> | stringMorph transformationMorph |
>> stringMorph := 'vertical text' asMorph.
>> transformationMorph := TransformationMorph new asFlexOf: stringMorph.
>> transformationMorph angle: Float pi / 2.
>> transformationMorph position: 5@5.
>> transformationMorph openInWorld.
>>
>> Lukas
>>
>> --
>> Lukas Renggli
>> http://www.lukas-renggli.ch
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>



--
Lukas Renggli
http://www.lukas-renggli.ch

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Problem with TransformationMorph

Henrik Sperre Johansen
In reply to this post by Stéphane Ducasse
It's not fixed in Squeak.
WarpBlt does not work with alpha 0 > < 1.
Another example is rotating a systemwindow (from the halo menu), its dropshadow will be pure black. (i.e. all non-transparent pixels are rendered with their pure RGB component)

Cheers,
Henry

(TransformationMorph is removed in Cuis 2.3, rotate halo button is there, but not working)

On Mar 26, 2010, at 9:31 39AM, Stéphane Ducasse wrote:

> lukas
>
> did you check in the latest version of squeak because I saw some fixes about put Morph in TextMorph?
> Also in Cuis 2.0 because I imagine that juan got the same transformation. Now it seems that he changed that.
>
> Stef
> On Mar 26, 2010, at 8:58 AM, Lukas Renggli wrote:
>
>> I noticed a problem with transformation morphs and created a bug report:
>>
>>  http://code.google.com/p/pharo/issues/detail?id=2207
>>
>> The problem seems to be that the transformation morph creates a black
>> rectangle on the rotated clipping bounds. I does not only happen with
>> TextMorphs but also with (some) other morphs. I tried to convert the
>> TextMorph to a SketchMorph and the same happens there. I have no idea
>> how to fix that problem. I need a solution because eCompletion rotates
>> some text by 90, which is currently not possible.
>>
>> | stringMorph transformationMorph |
>> stringMorph := 'vertical text' asMorph.
>> transformationMorph := TransformationMorph new asFlexOf: stringMorph.
>> transformationMorph angle: Float pi / 2.
>> transformationMorph position: 5@5.
>> transformationMorph openInWorld.
>>
>> Lukas
>>
>> --
>> Lukas Renggli
>> http://www.lukas-renggli.ch
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Problem with TransformationMorph

Lukas Renggli
> It's not fixed in Squeak.
> WarpBlt does not work with alpha 0 > < 1.
> Another example is rotating a systemwindow (from the halo menu), its dropshadow will be pure black. (i.e. all non-transparent pixels are rendered with their pure RGB component)

Ok, but what does this mean exactly?

Previously it was possible to have rotated text. When rotating text it
now shows the complete bounding box in black, not just the aliased
borders.

Lukas

>
> Cheers,
> Henry
>
> (TransformationMorph is removed in Cuis 2.3, rotate halo button is there, but not working)
>
> On Mar 26, 2010, at 9:31 39AM, Stéphane Ducasse wrote:
>
>> lukas
>>
>> did you check in the latest version of squeak because I saw some fixes about put Morph in TextMorph?
>> Also in Cuis 2.0 because I imagine that juan got the same transformation. Now it seems that he changed that.
>>
>> Stef
>> On Mar 26, 2010, at 8:58 AM, Lukas Renggli wrote:
>>
>>> I noticed a problem with transformation morphs and created a bug report:
>>>
>>>  http://code.google.com/p/pharo/issues/detail?id=2207
>>>
>>> The problem seems to be that the transformation morph creates a black
>>> rectangle on the rotated clipping bounds. I does not only happen with
>>> TextMorphs but also with (some) other morphs. I tried to convert the
>>> TextMorph to a SketchMorph and the same happens there. I have no idea
>>> how to fix that problem. I need a solution because eCompletion rotates
>>> some text by 90, which is currently not possible.
>>>
>>> | stringMorph transformationMorph |
>>> stringMorph := 'vertical text' asMorph.
>>> transformationMorph := TransformationMorph new asFlexOf: stringMorph.
>>> transformationMorph angle: Float pi / 2.
>>> transformationMorph position: 5@5.
>>> transformationMorph openInWorld.
>>>
>>> Lukas
>>>
>>> --
>>> Lukas Renggli
>>> http://www.lukas-renggli.ch
>>>
>>> _______________________________________________
>>> Pharo-project mailing list
>>> [hidden email]
>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>



--
Lukas Renggli
http://www.lukas-renggli.ch

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Problem with TransformationMorph

Henrik Sperre Johansen
Hmmm, are you running on the latest VM's?
With Pharo 1.1 and squeak 4.1, on both OSX and Windows I do not get black rectangles, but "expanded" black areas like attached.

Cheers,
Henry


On Mar 26, 2010, at 10:41 42AM, Lukas Renggli wrote:

>> It's not fixed in Squeak.
>> WarpBlt does not work with alpha 0 > < 1.
>> Another example is rotating a systemwindow (from the halo menu), its dropshadow will be pure black. (i.e. all non-transparent pixels are rendered with their pure RGB component)
>
> Ok, but what does this mean exactly?
>
> Previously it was possible to have rotated text. When rotating text it
> now shows the complete bounding box in black, not just the aliased
> borders.
>
> Lukas
>
>>
>> Cheers,
>> Henry
>>
>> (TransformationMorph is removed in Cuis 2.3, rotate halo button is there, but not working)
>>
>> On Mar 26, 2010, at 9:31 39AM, Stéphane Ducasse wrote:
>>
>>> lukas
>>>
>>> did you check in the latest version of squeak because I saw some fixes about put Morph in TextMorph?
>>> Also in Cuis 2.0 because I imagine that juan got the same transformation. Now it seems that he changed that.
>>>
>>> Stef
>>> On Mar 26, 2010, at 8:58 AM, Lukas Renggli wrote:
>>>
>>>> I noticed a problem with transformation morphs and created a bug report:
>>>>
>>>>  http://code.google.com/p/pharo/issues/detail?id=2207
>>>>
>>>> The problem seems to be that the transformation morph creates a black
>>>> rectangle on the rotated clipping bounds. I does not only happen with
>>>> TextMorphs but also with (some) other morphs. I tried to convert the
>>>> TextMorph to a SketchMorph and the same happens there. I have no idea
>>>> how to fix that problem. I need a solution because eCompletion rotates
>>>> some text by 90, which is currently not possible.
>>>>
>>>> | stringMorph transformationMorph |
>>>> stringMorph := 'vertical text' asMorph.
>>>> transformationMorph := TransformationMorph new asFlexOf: stringMorph.
>>>> transformationMorph angle: Float pi / 2.
>>>> transformationMorph position: 5@5.
>>>> transformationMorph openInWorld.
>>>>
>>>> Lukas
>>>>
>>>> --
>>>> Lukas Renggli
>>>> http://www.lukas-renggli.ch
>>>>
>>>> _______________________________________________
>>>> Pharo-project mailing list
>>>> [hidden email]
>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>>
>>>
>>> _______________________________________________
>>> Pharo-project mailing list
>>> [hidden email]
>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>>
>>
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
>
>
>
> --
> Lukas Renggli
> http://www.lukas-renggli.ch
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

verticalText.png (838 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Problem with TransformationMorph

Lukas Renggli
2010/3/26 Henrik Johansen <[hidden email]>:
> Hmmm, are you running on the latest VM's?

I am using the Squeak4.2.2beta1 VM on OS X.

The vertical text example looks like in the attached file.

Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

vertical-text.png (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Problem with TransformationMorph

Lukas Renggli
Ahh, with Squeak4.2.3beta1 I get the same as you.

Not perfect, but already better. Any idea how the ugly expanded areas
can be fixed?

Lukas

On 26 March 2010 11:06, Lukas Renggli <[hidden email]> wrote:

> 2010/3/26 Henrik Johansen <[hidden email]>:
>> Hmmm, are you running on the latest VM's?
>
> I am using the Squeak4.2.2beta1 VM on OS X.
>
> The vertical text example looks like in the attached file.
>
> Lukas
>
> --
> Lukas Renggli
> http://www.lukas-renggli.ch
>



--
Lukas Renggli
http://www.lukas-renggli.ch

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Problem with TransformationMorph

Henrik Sperre Johansen

On Mar 26, 2010, at 11:11 47AM, Lukas Renggli wrote:

> Ahh, with Squeak4.2.3beta1 I get the same as you.
>
> Not perfect, but already better. Any idea how the ugly expanded areas
> can be fixed?
>
> Lukas

If the text background color is consistent, it should be fakeble in image.
Otherwise I'd reckon it requires more BitBlt fixes.

Look at the text in a rotated browser first, that's the result you can expect.
Basic way would be to instead of rendering the text glyphs rotated, render the glyphs on top of a bitmap of the proper rotated background, then rotate that opaque bitmap instead.
Not a perfect solution by any means, but it can be done if you're desperate enough... waiting for VM fixes can take a looooong time :(

Cheers,
Henry
_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Problem with TransformationMorph

Lukas Renggli
> If the text background color is consistent, it should be fakeble in image.
> Otherwise I'd reckon it requires more BitBlt fixes.

Ok, converting the string morph to a bitmap works indeed. The text is
readable. However the transparency does not work.

I hope the VM gets fixed :-)

> Look at the text in a rotated browser first, that's the result you can expect.
> Basic way would be to instead of rendering the text glyphs rotated, render the glyphs on top of a bitmap of the proper rotated background, then rotate that opaque bitmap instead.
> Not a perfect solution by any means, but it can be done if you're desperate enough... waiting for VM fixes can take a looooong time :(

Are there any examples for that?

Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

completion.png (29K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Problem with TransformationMorph

Henrik Sperre Johansen

On Mar 26, 2010, at 11:37 27AM, Lukas Renggli wrote:

>> If the text background color is consistent, it should be fakeble in image.
>> Otherwise I'd reckon it requires more BitBlt fixes.
>
> Ok, converting the string morph to a bitmap works indeed. The text is
> readable. However the transparency does not work.
>
> I hope the VM gets fixed :-)
>
>> Look at the text in a rotated browser first, that's the result you can expect.
>> Basic way would be to instead of rendering the text glyphs rotated, render the glyphs on top of a bitmap of the proper rotated background, then rotate that opaque bitmap instead.
>> Not a perfect solution by any means, but it can be done if you're desperate enough... waiting for VM fixes can take a looooong time :(
>
> Are there any examples for that?
>
> Lukas

CornerRounder works this way.
These are the basic steps (performed in method roundCornersOf: on: in: displayBlock: borderWidth:  corners: )
1. copy bits below to a bitmap.
2. render normal corner to bitmap 2.
3. mask out the rounded bits in bitmap 2.
4. render bitmap2 on top of bitmap1.
5. display the composite on screen.

You'd probably skip 2 and 3 for text, replace 4 with "render text", and add:
2. rotate bits -X degrees
4.5 rotate bits X degrees.

Cheers,
Henry
_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project