From 63721c5db1bc1c4a53ee2af536ffbd19b015fdb9 Mon Sep 17 00:00:00 2001 From: Elliot Smith Date: Fri, 12 Nov 2010 09:54:12 +0000 Subject: [PATCH] cookbook: Fix opacity examples in recipe The recipe had examples where opacity was set using fractional numbers. Fixed all examples to use integers only. --- doc/cookbook/actors.xml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/doc/cookbook/actors.xml b/doc/cookbook/actors.xml index 8c8a9a479..d590fce02 100644 --- a/doc/cookbook/actors.xml +++ b/doc/cookbook/actors.xml @@ -276,10 +276,10 @@ on_paint (ClutterActor *actor) /* 25% transparency */ -clutter_actor_set_opacity (actor, 191.25); +clutter_actor_set_opacity (actor, 191); /* 50% transparency */ -clutter_actor_set_opacity (actor, 122.5); +clutter_actor_set_opacity (actor, 122); /* completely transparent */ clutter_actor_set_opacity (actor, 0); @@ -325,13 +325,13 @@ clutter_actor_set_opacity (actor, 0); top-left: 255 (0% transparency) - top-right: 191.25 (25% transparency) + top-right: 191 (25% transparency) - bottom-right: 122.5 (50% transparency) + bottom-right: 122 (50% transparency) - bottom-left: 61.25 (75% transparency) + bottom-left: 61 (75% transparency) @@ -350,10 +350,10 @@ clutter_actor_set_opacity (actor, 0); If a container has its opacity set, any children of the container have their opacity combined with their parent's opacity. - For example, if a parent has an opacity of 122.5 + For example, if a parent has an opacity of 122 (50% transparent) and the child also has an opacity of - 122.5, the child's effective - opacity is 25% (opacity = 61.25, and it is + 122, the child's effective + opacity is 25% (opacity = 61, and it is 75% transparent). To demonstrate the visual effect of this, here are @@ -382,14 +382,14 @@ clutter_actor_set_opacity (actor, 0); The middle rectangle has opacity = 255 and is in a ClutterGroup with - opacity = 122.5. Notice that the parent opacity + opacity = 122. Notice that the parent opacity makes the rectangle appear darker, as the stage colour is showing through from behind. - The right-hand rectangle has opacity = 122.5 + The right-hand rectangle has opacity = 122 and is in a ClutterGroup with - opacity = 122.5. Notice that the rectangle appears + opacity = 122. Notice that the rectangle appears to be even darker, as the stage colour is showing through both the rectangle and its parent. @@ -405,12 +405,12 @@ clutter_actor_set_opacity (actor, 0);