CrossMorph in PBE and compositing bug
Hello, In the PBE example, and CrossMorph is created. As can be seen from its name, It is has a cross shape. When one adds keyboard handling to move it about, it seems the compositor thinks it is opaque, and doesnât repaint the ânot crossâ areas with whatever is behind the morph. The result is the shape smears across the screen. This only occurs when moving exactly horizontally or vertically. Iâve been looking over the Morph API but canât detect a method like #opaque: or #translucent: or similar. Is this a bug, or am I missing the correct way to deal with transparent/irregular shaped morphs? Thanks, -Ed
Hello, Morph color can be set to translucent, in your example it is problably set with ColorTranslucent r:g:b or a similar class. Not sure about the name. Hilaire Le 26/12/2014 20:43, Edward Povazan a écrit :
Hello,
In the PBE example, and CrossMorph is created. As can be seen from its name, It is has a cross shape.
When one adds keyboard handling to move it about, it seems the compositor thinks it is opaque, and doesnât repaint the ânot crossâ areas with whatever is behind the morph.
The result is the shape smears across the screen. This only occurs when moving exactly horizontally or vertically.
Iâve been looking over the Morph API but canât detect a method like #opaque: or #translucent: or similar.
Is this a bug, or am I missing the correct way to deal with transparent/irregular shaped morphs?
Thanks, -Ed
-- Dr. Geo - http://drgeo.eu iStoa - http://istoa.drgeo.eu
Thanks. It does work to add a little alpha to the colour, but is there no other way? If I want a solid colour, then what? I should be able to say âthis is a weird shaped morph, not a rectangleâ, but not seeing it. -Ed
On Dec 26, 2014, at 11:58 AM, Hilaire <hilaire@drgeo.eu> wrote:
Hello,
Morph color can be set to translucent, in your example it is problably set with ColorTranslucent r:g:b or a similar class. Not sure about the name.
Hilaire
Le 26/12/2014 20:43, Edward Povazan a écrit :
Hello,
In the PBE example, and CrossMorph is created. As can be seen from its name, It is has a cross shape.
When one adds keyboard handling to move it about, it seems the compositor thinks it is opaque, and doesnât repaint the ânot crossâ areas with whatever is behind the morph.
The result is the shape smears across the screen. This only occurs when moving exactly horizontally or vertically.
Iâve been looking over the Morph API but canât detect a method like #opaque: or #translucent: or similar.
Is this a bug, or am I missing the correct way to deal with transparent/irregular shaped morphs?
Thanks, -Ed
-- Dr. Geo - http://drgeo.eu iStoa - http://istoa.drgeo.eu
did you try put alpha to zero? Le 27/12/14 04:10, Edward Povazan a écrit :
Thanks. It does work to add a little alpha to the colour, but is there no other way? If I want a solid colour, then what? I should be able to say âthis is a weird shaped morph, not a rectangleâ, but not seeing it.
-Ed
On Dec 26, 2014, at 11:58 AM, Hilaire <hilaire@drgeo.eu> wrote:
Hello,
Morph color can be set to translucent, in your example it is problably set with ColorTranslucent r:g:b or a similar class. Not sure about the name.
Hilaire
Le 26/12/2014 20:43, Edward Povazan a écrit :
Hello,
In the PBE example, and CrossMorph is created. As can be seen from its name, It is has a cross shape.
When one adds keyboard handling to move it about, it seems the compositor thinks it is opaque, and doesnât repaint the ânot crossâ areas with whatever is behind the morph.
The result is the shape smears across the screen. This only occurs when moving exactly horizontally or vertically.
Iâve been looking over the Morph API but canât detect a method like #opaque: or #translucent: or similar.
Is this a bug, or am I missing the correct way to deal with transparent/irregular shaped morphs?
Thanks, -Ed
-- Dr. Geo - http://drgeo.eu iStoa - http://istoa.drgeo.eu
2014-12-27 4:10 GMT+01:00 Edward Povazan <empovazan@gmail.com>:
Thanks. It does work to add a little alpha to the colour, but is there no other way? If I want a solid colour, then what? I should be able to say âthis is a weird shaped morph, not a rectangleâ, but not seeing it.
-Ed
Hi Edward There are two possible solutions: If you look at for example StringMorph, PolygonMorph or EllipseMorph and to their "drawing" protocoll, you'll see they overwrite areasRemainingToFill: if you copy this method to the CrossMorph class, it will work as you want. The reason for this is, the default morph uses its color to paint the whole area and don't need to care about the underlying area. The second solution, as you may have seen from looking at the code in Morph areasRemainingToFill: is to use a transparent color ("Color transparent") for your morph (the default color is "Color blue") and use a different color actually for painting the cross. (for example, you can add another instance variable "crossColor" and use that one in the drawOn: method. nicolai
On Dec 26, 2014, at 11:58 AM, Hilaire <hilaire@drgeo.eu> wrote:
Hello,
Morph color can be set to translucent, in your example it is problably set with ColorTranslucent r:g:b or a similar class. Not sure about the name.
Hilaire
Le 26/12/2014 20:43, Edward Povazan a écrit :
Hello,
In the PBE example, and CrossMorph is created. As can be seen from its name, It is has a cross shape.
When one adds keyboard handling to move it about, it seems the compositor thinks it is opaque, and doesnât repaint the ânot crossâ areas with whatever is behind the morph.
The result is the shape smears across the screen. This only occurs when moving exactly horizontally or vertically.
Iâve been looking over the Morph API but canât detect a method like #opaque: or #translucent: or similar.
Is this a bug, or am I missing the correct way to deal with transparent/irregular shaped morphs?
Thanks, -Ed
-- Dr. Geo - http://drgeo.eu iStoa - http://istoa.drgeo.eu
Thank you Nicolai, areasRemainingToFill: is what I was looking for, did not see it due to looking for âtransparentâ or âopaqueâ or similar message. -Edward ^ Array with: aRectangle
On Dec 27, 2014, at 6:38 AM, Nicolai Hess <nicolaihess@web.de> wrote:
2014-12-27 4:10 GMT+01:00 Edward Povazan <empovazan@gmail.com <mailto:empovazan@gmail.com>>: Thanks. It does work to add a little alpha to the colour, but is there no other way? If I want a solid colour, then what? I should be able to say âthis is a weird shaped morph, not a rectangleâ, but not seeing it.
-Ed
Hi Edward There are two possible solutions:
If you look at for example StringMorph, PolygonMorph or EllipseMorph and to their "drawing" protocoll, you'll see they overwrite areasRemainingToFill: if you copy this method to the CrossMorph class, it will work as you want.
The reason for this is, the default morph uses its color to paint the whole area and don't need to care about the underlying area.
The second solution, as you may have seen from looking at the code in Morph areasRemainingToFill: is to use a transparent color ("Color transparent") for your morph (the default color is "Color blue") and use a different color actually for painting the cross. (for example, you can add another instance variable "crossColor" and use that one in the drawOn: method.
nicolai
On Dec 26, 2014, at 11:58 AM, Hilaire <hilaire@drgeo.eu <mailto:hilaire@drgeo.eu>> wrote:
Hello,
Morph color can be set to translucent, in your example it is problably set with ColorTranslucent r:g:b or a similar class. Not sure about the name.
Hilaire
Le 26/12/2014 20:43, Edward Povazan a écrit :
Hello,
In the PBE example, and CrossMorph is created. As can be seen from its name, It is has a cross shape.
When one adds keyboard handling to move it about, it seems the compositor thinks it is opaque, and doesnât repaint the ânot crossâ areas with whatever is behind the morph.
The result is the shape smears across the screen. This only occurs when moving exactly horizontally or vertically.
Iâve been looking over the Morph API but canât detect a method like #opaque: or #translucent: or similar.
Is this a bug, or am I missing the correct way to deal with transparent/irregular shaped morphs?
Thanks, -Ed
-- Dr. Geo - http://drgeo.eu <http://drgeo.eu/> iStoa - http://istoa.drgeo.eu <http://istoa.drgeo.eu/>
participants (4)
-
Edward Povazan -
Hilaire -
Nicolai Hess -
stepharo