Canvas transform bug when rendering text?

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

Re: Canvas transform bug when rendering text?

Michael Rueger-6
On 4/10/2010 11:04 AM, Hilaire Fernandes wrote:

> I remember you were using XUL for UI definition in Sophie, why this choice?

In combination with CSS it allowed us to change the UI without changing
the code (at least to some extend). Basically skinning through external
files, as you would do with a properly done web site.

Michael

_______________________________________________
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: Canvas transform bug when rendering text?

hilaire
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Canvas transform bug when rendering text?

Michael Rueger-6
On Sat, Apr 10, 2010 at 11:33 AM, Hilaire Fernandes
<[hidden email]> wrote:

> Michael Rueger a écrit :
>>
>> On 4/10/2010 11:04 AM, Hilaire Fernandes wrote:
>
>> In combination with CSS it allowed us to change the UI without changing
>> the code (at least to some extend). Basically skinning through external
>> files, as you would do with a properly done web site.
>
> And how do you fell about it now?  Will you do the same choice if starting
> from now?

Basically yes, although some of the internal aspects could be
improved. Largely has to do with the way we sort of had to retrofit it
onto Tweak.

Michael

_______________________________________________
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: Canvas transform bug when rendering text?

David Harvey
In reply to this post by David Harvey
Henrik, all, thanks for your help with this. I've been away from the codeface for a while and haven't yet tried all of the fixes. I did get things rendering well by caching the form canvas and redrawing that when required (just as the HandMorph does - as I said, the rendering while dragging is always OK). Relevant code below:

>>>>
drawOn: aCanvas
super drawOn: aCanvas.

cachedCanvas isNil ifTrue: [
cachedCanvas := (aCanvas allocateForm: self bounds extent) getCanvas.
self drawContentsOn: cachedCanvas.
].
aCanvas translucentImage: cachedCanvas form at: self bounds origin.
<<<<

Best
David


------------------
David Harvey
www.teamsandtechnology.com
www.cateams.com
@david_harvey


On 7 April 2010 12:45, David Harvey <[hidden email]> wrote:
Hi list,

I'm writing a little charting morph, and while playing with rotating text for axis labels came across something which I've noted in Morphs text handling a couple of times. 

If I apply a transform in a drawing operation, rotated text _appears_ to be drawn twice, slightly offset, giving a scrappy bold look. It seems only to do this when drawing on a form canvas that's backed onto the display: if you pick and drag the morph, the text is rendered beautifully.

The test morph attached isolates the problem. The transcript logging is an attempt to see what might be happening: looking at the output it appears that there are circumstances in which the during: block is invoked twice.

Any thoughts?

David

------------------
David Harvey
www.teamsandtechnology.com
www.cateams.com
@david_harvey


_______________________________________________
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: Canvas transform bug when rendering text?

Henrik Sperre Johansen
In reply to this post by Lukas Renggli
  Sorry for responding so late. but...
On 09.04.2010 11:14, Lukas Renggli wrote:
> Pay attention there is a #haltOnce in the code. Also there is
> something wrong with the line endings in the change-set.
>
:( Didn't have time to review it before submission at the time, so some
debug code was left in.
> However it also breaks some window refreshing, see attached screenshot.
>
> Lukas

Yes, for some reason, 1.0 does not contain
TransformMorph >> areasRemainingTofFill: aRectangle

     ^Array with: aRectangle

Which is needed for a proper refresh.
As you noticed, at least it's quite visible when not present, so one is
forced to determine what the proper return value should be,
Basically, areasRemaining...: should denote the non-opaque areas of the
morph.
This is mostly used in the drawing algorithm, to determine coverage of a
morph,  and thus which areas remain to be drawn below it.
In the case of TransformMorph, the calculation for returning a decent
estimate is probably more work than just telling it to draw everything
below (ie. return the rectangle as the area that remains to be drawn),
so that's what we do. If you have a better default, please suggest it! :D

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: Canvas transform bug when rendering text?

Stéphane Ducasse
we should release 1.1 much faster :)
like that people will be able to get all the fixes....

Stef

On Apr 18, 2010, at 2:42 AM, Henrik Sperre Johansen wrote:

> Sorry for responding so late. but...
> On 09.04.2010 11:14, Lukas Renggli wrote:
>> Pay attention there is a #haltOnce in the code. Also there is
>> something wrong with the line endings in the change-set.
>>
> :( Didn't have time to review it before submission at the time, so some debug code was left in.
>> However it also breaks some window refreshing, see attached screenshot.
>>
>> Lukas
>
> Yes, for some reason, 1.0 does not contain
> TransformMorph >> areasRemainingTofFill: aRectangle
>
>    ^Array with: aRectangle
>
> Which is needed for a proper refresh.
> As you noticed, at least it's quite visible when not present, so one is forced to determine what the proper return value should be,
> Basically, areasRemaining...: should denote the non-opaque areas of the morph.
> This is mostly used in the drawing algorithm, to determine coverage of a morph,  and thus which areas remain to be drawn below it.
> In the case of TransformMorph, the calculation for returning a decent estimate is probably more work than just telling it to draw everything below (ie. return the rectangle as the area that remains to be drawn), so that's what we do. If you have a better default, please suggest it! :D
>
> Cheers,
> Henry
>
> _______________________________________________
> 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: Canvas transform bug when rendering text?

Michael Roberts-2
On Sun, Apr 18, 2010 at 8:21 AM, Stéphane Ducasse
<[hidden email]> wrote:
> we should release 1.1 much faster :)
> like that people will be able to get all the fixes....

yes ;)

for tagging fixes for 1.0 maintenance, should we use a milestone 1.0.1
in the tracker?   - is this code candidate for 1.0.1?

cheers,
Mike

_______________________________________________
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: Canvas transform bug when rendering text?

Stéphane Ducasse

On Apr 18, 2010, at 10:32 AM, Michael Roberts wrote:

> On Sun, Apr 18, 2010 at 8:21 AM, Stéphane Ducasse
> <[hidden email]> wrote:
>> we should release 1.1 much faster :)
>> like that people will be able to get all the fixes....
>
> yes ;)
>
> for tagging fixes for 1.0 maintenance, should we use a milestone 1.0.1
> in the tracker?   - is this code candidate for 1.0.1?

1.0.1 would be better because we really want to not spend too much time on this one
since far too many fixes were made in 1.1

Stef

>
> cheers,
> Mike
>
> _______________________________________________
> 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: Canvas transform bug when rendering text?

Adrian Lienhard
Yes, please tag important fixes with milestone 1.0.1. I added this milestone as a predefined label (so it will show up in the autocompleter).

Adrian

On Apr 18, 2010, at 13:12 , Stéphane Ducasse wrote:

>
> On Apr 18, 2010, at 10:32 AM, Michael Roberts wrote:
>
>> On Sun, Apr 18, 2010 at 8:21 AM, Stéphane Ducasse
>> <[hidden email]> wrote:
>>> we should release 1.1 much faster :)
>>> like that people will be able to get all the fixes....
>>
>> yes ;)
>>
>> for tagging fixes for 1.0 maintenance, should we use a milestone 1.0.1
>> in the tracker?   - is this code candidate for 1.0.1?
>
> 1.0.1 would be better because we really want to not spend too much time on this one
> since far too many fixes were made in 1.1
>
> Stef
>
>>
>> cheers,
>> Mike
>>
>> _______________________________________________
>> 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
12