+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),
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);
}
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);
}
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);
}
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)
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);
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);