red / REP

Red Enhancement Process
BSD 3-Clause "New" or "Revised" License
11 stars 4 forks source link

Sync problem modifying the GUI event when auto-sync? is false #169

Open GiuseppeChillemi opened 1 month ago

GiuseppeChillemi commented 1 month ago

I want to create a GUI which enlarges laterally on the press of a button, as do some task bars and then hide. This is a test script and I am encountering a problems: visible trails and flickering, when resizing even with auto-sync?: false and manual syncing. Click "enlarge" multiple time to test it, you will see the phantom of redrawing at each change

system/view/auto-sync?: off
enlargement: 100

view l: layout [
    p: panel 80x150 [
        Below
        Button "UltraEdit" 60x50 [
        ]       
        pad 0x20
        button "Enlarge" [
            case [
                face/extra = none [
                    l/offset/x: l/offset/x - enlargement
                    l/size/x: l/size/x + enlargement
                    p/offset/x: p/offset/x + enlargement 
                    face/extra: 'enlarged
                    show l
                    show p
                ]
                face/extra = 'enlarged [
                    l/offset/x: l/offset/x + enlargement
                    l/size/x: l/size/x - enlargement
                    p/offset/x: p/offset/x - enlargement
                    face/extra: none
                    show l      
                    show p
                ]

            ]

        ]           
    ]
]

I expected that all drawing are done after showing the panel but it seems it happens after that, redrawing the with the previous values and then with the new one. Hiiamboris thinks that internally offset and size are updated in two separate moments.

Discussion started here:

https://matrix.to/#/!ARPBrpwJJYziTJYuJj:gitter.im/$636aa6uwb0a4_GHPCvgomMqed1JydlRUQYtTe4qDQ20?via=gitter.im&via=matrix.org&via=tchncs.de

It would be nice to fix this beaviour to reach clean, no trails and flickering free updating

ldci commented 1 month ago

An error in your code: shop p must be replaced by show p

GiuseppeChillemi commented 1 month ago

An error in your code: shop p must be replaced by show p

Fixed, thanks