andfanilo / streamlit-drawable-canvas

Do you like Quick, Draw? Well what if you could train/predict doodles drawn inside Streamlit? Also draws lines, circles and boxes over background images for annotation.
https://drawable-canvas.streamlit.app/
MIT License
576 stars 88 forks source link

drawing moving sometimes #91

Closed bratwurstmuesli closed 2 years ago

bratwurstmuesli commented 2 years ago

Problem:

somtimes the drawing seems to move. I can reproduce it. image

this is the code i am using:

import pandas as pd
from PIL import Image
import streamlit as st
from streamlit_drawable_canvas import st_canvas

def main():
    st.title("Drawing Test")
    st.write("Tester for drawing with andfanilo/streamlit-drawable-canvas")

    # Create a canvas component
    canvas_result = st_canvas(
        fill_color="rgba(255, 165, 0, 0.3)",  # Fixed fill color with some opacity
        stroke_width="2",
        stroke_color="#198E06",
        update_streamlit=False,
        height=600,
        width = 400,
        drawing_mode="freedraw",
        key="canvas",
    )

Is there a solution for this problem? It seems to only happen on my apps. I can not reproduce that in any of the demos here: https://drawable-canvas.streamlitapp.com/