From c69b2ff20010e90754a3e66db53d7384bfc0aa2e Mon Sep 17 00:00:00 2001 From: Mathieu Virbel Date: Wed, 19 Sep 2012 01:23:19 +0200 Subject: [PATCH] doc fixes --- kivy/graphics/instructions.pyx | 17 ++++++++++++++++- kivy/uix/widget.py | 4 ++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/kivy/graphics/instructions.pyx b/kivy/graphics/instructions.pyx index 090505ac7..10e8ca3ba 100644 --- a/kivy/graphics/instructions.pyx +++ b/kivy/graphics/instructions.pyx @@ -584,7 +584,22 @@ cdef class Canvas(CanvasBase): return self._after property opacity: - '''Property for getting the opacity value + '''Property for get/set the opacity value of the canvas. + + .. versionadded:: 1.4.1 + + The opacity attribute controls the opacity of the canvas and its + children. Be careful, it's a cumulative attribute: the value is + multiplied to the current global opacity, and the result is applied to + the current context color. + + For example: if your parent have an opacity of 0.5, and one children have an + opacity of 0.2, the real opacity of the children will be 0.5 * 0.2 = 0.1. + + Then, the opacity is applied on the shader as:: + + frag_color = color * vec4(1.0, 1.0, 1.0, opacity); + ''' def __get__(self): return self._opacity diff --git a/kivy/uix/widget.py b/kivy/uix/widget.py index 43755a65f..f06dd326f 100644 --- a/kivy/uix/widget.py +++ b/kivy/uix/widget.py @@ -537,8 +537,8 @@ class Widget(EventDispatcher): .. versionadded:: 1.4.1 - The opacity attribute control the opacity of the widget and the children. - Take care, it's a cumulative attribute: the value is multiplied to the + The opacity attribute controls the opacity of the widget and its children. + Be careful, it's a cumulative attribute: the value is multiplied to the current global opacity, and the result is applied to the current context color.