mirror of
https://github.com/brl/mutter.git
synced 2024-11-09 23:46:33 -05:00
2006-09-20 Matthew Allum <mallum@openedhand.com>
* clutter/clutter-actor.c: (clutter_actor_paint): * clutter/clutter-clone-texture.c: (clutter_clone_texture_paint): * clutter/clutter-group.c: (clutter_group_paint): * clutter/clutter-rectangle.c: (clutter_rectangle_paint): * clutter/clutter-texture.c: (clutter_texture_paint): Fix for #156. clutter_actor_paint() now translates to actor position as to not fix scaled groups positioning. Sub classes now paint at 0,0.
This commit is contained in:
parent
94c0e54bc3
commit
1bd964c757
12
ChangeLog
12
ChangeLog
@ -1,3 +1,15 @@
|
||||
2006-09-20 Matthew Allum <mallum@openedhand.com>
|
||||
|
||||
* clutter/clutter-actor.c: (clutter_actor_paint):
|
||||
* clutter/clutter-clone-texture.c: (clutter_clone_texture_paint):
|
||||
* clutter/clutter-group.c: (clutter_group_paint):
|
||||
* clutter/clutter-rectangle.c: (clutter_rectangle_paint):
|
||||
* clutter/clutter-texture.c: (clutter_texture_paint):
|
||||
Fix for #156.
|
||||
clutter_actor_paint() now translates to actor position as
|
||||
to not fix scaled groups positioning. Sub classes now paint
|
||||
at 0,0.
|
||||
|
||||
2006-09-19 Matthew Allum <mallum@openedhand.com>
|
||||
|
||||
* clutter/clutter-actor.c: (redraw_update_idle),
|
||||
|
@ -255,29 +255,35 @@ clutter_actor_paint (ClutterActor *self)
|
||||
|
||||
glLoadName (clutter_actor_get_id (self));
|
||||
|
||||
if (clutter_actor_get_parent (self) != NULL)
|
||||
{
|
||||
glTranslatef((float)(self->priv->coords.x1),
|
||||
(float)(self->priv->coords.y1),
|
||||
0.0);
|
||||
}
|
||||
|
||||
if (self->priv->rzang)
|
||||
{
|
||||
glTranslatef ( (float)(self->priv->coords.x1) + self->priv->rzx,
|
||||
(float)(self->priv->coords.y1) + self->priv->rzy,
|
||||
glTranslatef ( self->priv->rzx,
|
||||
self->priv->rzy,
|
||||
0.0);
|
||||
|
||||
glRotatef (self->priv->rzang, 0.0f, 0.0f, 1.0f);
|
||||
|
||||
glTranslatef ( (-1.0 * self->priv->coords.x1) - self->priv->rzx,
|
||||
(-1.0 * self->priv->coords.y1) - self->priv->rzy,
|
||||
glTranslatef ( - self->priv->rzx,
|
||||
- self->priv->rzy,
|
||||
0.0 );
|
||||
}
|
||||
|
||||
if (self->priv->ryang)
|
||||
{
|
||||
glTranslatef ( (float)(self->priv->coords.x1) + self->priv->ryx,
|
||||
glTranslatef ( self->priv->ryx,
|
||||
0.0,
|
||||
(float)(self->priv->z) + self->priv->ryz);
|
||||
|
||||
glRotatef (self->priv->ryang, 0.0f, 1.0f, 0.0f);
|
||||
|
||||
glTranslatef ( (float)(-1.0 * self->priv->coords.x1) - self->priv->ryx,
|
||||
glTranslatef ( (float) - self->priv->ryx,
|
||||
0.0,
|
||||
(float)(-1.0 * self->priv->z) - self->priv->ryz);
|
||||
}
|
||||
@ -285,13 +291,13 @@ clutter_actor_paint (ClutterActor *self)
|
||||
if (self->priv->rxang)
|
||||
{
|
||||
glTranslatef ( 0.0,
|
||||
(float)(self->priv->coords.x1) + self->priv->rxy,
|
||||
(float)self->priv->rxy,
|
||||
(float)(self->priv->z) + self->priv->rxz);
|
||||
|
||||
glRotatef (self->priv->rxang, 1.0f, 0.0f, 0.0f);
|
||||
|
||||
glTranslatef ( 0.0,
|
||||
(float)(-1.0 * self->priv->coords.x1) - self->priv->rxy,
|
||||
(float) - self->priv->rxy,
|
||||
(float)(-1.0 * self->priv->z) - self->priv->rxz);
|
||||
}
|
||||
|
||||
|
@ -204,8 +204,9 @@ clutter_clone_texture_paint (ClutterActor *self)
|
||||
CLUTTER_DBG("paint to x1: %i, y1: %i x2: %i, y2: %i opacity: %i",
|
||||
x1, y1, x2, y2, clutter_actor_get_opacity(self) );
|
||||
|
||||
/* Parent paint translated us into position */
|
||||
clone_texture_render_to_gl_quad (CLUTTER_CLONE_TEXTURE(self),
|
||||
x1, y1, x2, y2);
|
||||
0, 0, x2 - x1, y2 - y1);
|
||||
glDisable(target_type);
|
||||
glDisable(GL_BLEND);
|
||||
}
|
||||
|
@ -67,21 +67,6 @@ clutter_group_paint (ClutterActor *actor)
|
||||
|
||||
glPushMatrix();
|
||||
|
||||
/* Translate if parent ( i.e not stage window ).
|
||||
*/
|
||||
if (clutter_actor_get_parent (actor) != NULL)
|
||||
{
|
||||
ClutterGeometry geom;
|
||||
|
||||
clutter_actor_get_geometry (actor, &geom);
|
||||
|
||||
if (geom.x != 0 || geom.y != 0)
|
||||
{
|
||||
glTranslatef(geom.x, geom.y, 0.0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
for (child_item = self->priv->children;
|
||||
child_item != NULL;
|
||||
child_item = child_item->next)
|
||||
|
@ -77,10 +77,10 @@ clutter_rectangle_paint (ClutterActor *self)
|
||||
priv->color.blue,
|
||||
clutter_actor_get_opacity (self));
|
||||
|
||||
glRecti (geom.x,
|
||||
geom.y,
|
||||
geom.x + geom.width,
|
||||
geom.y + geom.height);
|
||||
/* parent paint call will have translated us into position so
|
||||
* paint from 0,0
|
||||
*/
|
||||
glRecti (0, 0, geom.width, geom.height);
|
||||
|
||||
glDisable(GL_BLEND);
|
||||
|
||||
|
@ -660,7 +660,8 @@ clutter_texture_paint (ClutterActor *self)
|
||||
glColor4ub(255, 255, 255, opacity);
|
||||
|
||||
clutter_actor_get_coords (self, &x1, &y1, &x2, &y2);
|
||||
texture_render_to_gl_quad (texture, x1, y1, x2, y2);
|
||||
/* Paint will of translated us */
|
||||
texture_render_to_gl_quad (texture, 0, 0, x2 - x1, y2 - y1);
|
||||
|
||||
glDisable(texture->priv->target_type);
|
||||
glDisable(GL_BLEND);
|
||||
|
Loading…
Reference in New Issue
Block a user