Ian Warwick

    Ian Warwick

    2 years ago
    Hey folks not sure why this is happening, I have a vector that seems to draw over itself depending on how I structure my compose tree, I have two
    @Composable
    s, one
    DrawVectorToggle()
    and another version
    DrawVectorToggleDRY()
    The first one draws a toggle and toggles up and down fine but the second ones vector draws over the first state when toggled, anyone see anything wrong here in usage pattern that could be causing this?
    this is what happens with the
    DrawVectorToggleDRY()
    version
    The
    DrawVectorToggle()
    version draws vectors without the glitch when toggling
    Chuck Jazdzewski [G]

    Chuck Jazdzewski [G]

    2 years ago
    There are a couple of bugs at work here that are tripping you up, both of which we have fixed in master. First there was a vector caching bug. If the sizes of the vector graphic images are identical it doesn't realize it changed. Second, effects were not correctly memoized in this case (the + unary operator always used the same key for different source locations) which causes the same vectors objects to be used instead of different version causing the above issue to manifest. Until dev04, the easiest way to work around this, you can make the size of the vector images different in some visually indistinguishable way.
    Ian Warwick

    Ian Warwick

    2 years ago
    Thanks @Chuck Jazdzewski [G] that explains it cheers 🙂