Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RoundedRectangle doesn't update when width or height == 0 #6056

Open
tshirtman opened this issue Nov 24, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@tshirtman
Copy link
Member

commented Nov 24, 2018

Versions

  • Python:
  • OS: ubuntu
  • Kivy: 1.11.0-dev (a33ed47)
  • Kivy installation method: git

Description

If a RoundedRectangle's size changes and one of the size's component is 0, then the build function exists early, and the vertex instruction is not updated, instead, the method should probably just batch an empty set of instructions (or minimal), so the previously displayed vertices are replaced.

Code and Logs

from kivy.app import App
from kivy.lang import Builder
from kivy.properties import BooleanProperty


KV = '''
BoxLayout:
    Button:
        text: 'hide' if app.show else 'show'
        on_press: app.show = not app.show

    Widget:
        canvas:
            RoundedRectangle:
                pos: self.pos
                size: self.width, self.height if app.show else 0
                radius: 10, 10, 10, 10
'''

class MApp(App):
    show = BooleanProperty(False)

    def build(self):
        return Builder.load_string(KV)

if __name__ == '__main__':
    MApp().run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.