ConditionSwitch() will override child displayable position properties with the previous child's position properties

Bug #680266 reported by Spiky Caterpillar on 2010-11-22
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fix Released
Tom Rothamel

Bug Description

The following code would be expected to display 'Right' on the right and 'Left' on the left; instead, the first time 'Left' is displayed, it will be on the right side, as a result of the fact that ConditionSwitches call update_state before rendering their children.

    image test = ConditionSwitch('pos=="right"',Text('Right',xalign=1.0,yalign=0.5),'pos=="left"',Text('Left',xalign=0.0,yalign=0.5))
    $ pos = 'right'
    show test
    "Test on right"
    $ pos = 'left'
    "Test should be on left."
    "Test should be on left again."

Moving the call to self.update_state() in renpy.display.motion.Transform.render() after the child displayable is rendered fixes the bug; I haven't noticed the change causing any new problems, but I haven't tested extensively.

That first patch causes a traceback on at least some ATL animations (for example,

    show expression im.Composite((1600,600),
        (800,0),current_cell.background(new_facing)) behind border:
        ypos 32
        xpos 208
        anchor (0,0)
        linear .5 xpos (208-800)

since apparently the child is first set inside update_state. A possibly better patch is attached.

Tom Rothamel (renpytom) wrote :

Fixed in the dev branch, aiming at a slightly more fundamental issue.

Changed in renpy:
milestone: none → 6.12
importance: Undecided → Medium
assignee: nobody → renpytom (renpytom)
status: New → Fix Committed
Tom Rothamel (renpytom) on 2011-02-08
Changed in renpy:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers