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

missing circles with fast signing speed #716

Open
opa-rudi opened this issue Apr 27, 2023 · 17 comments
Open

missing circles with fast signing speed #716

opa-rudi opened this issue Apr 27, 2023 · 17 comments

Comments

@opa-rudi
Copy link

I found out that there are single circles (when signing dots) missing sometimes especially when using higher signing speed and slower processors (smartphones). Is there a workaround?

@opa-rudi opa-rudi changed the title missing circles when fast signing speed missing circles with fast signing speed Apr 27, 2023
@UziTech
Copy link
Collaborator

UziTech commented Apr 27, 2023

You could try turning off throttling https://github.com/szimek/signature_pad#options

@opa-rudi
Copy link
Author

It is already turned off (set to 0). Can you reproduce this issue?

@UziTech
Copy link
Collaborator

UziTech commented Apr 27, 2023

I can't reproduce this. There is a sensitivity setting on smartphones to prevent accidental touches. My guess is that is too high for fast signatures

@opa-rudi
Copy link
Author

opa-rudi commented Apr 27, 2023

I forgot to say that the signature is drawn on the canvas correctely but when exporting the svg some circles are missing. Sorry for that. You can check this also on the demo page. It also happend there (in my case).

@UziTech
Copy link
Collaborator

UziTech commented Apr 27, 2023

Can you provide a list of data points that it does this to? And a video of this happening could be helpful. Also provide information on what type of phone and browser it is.

@opa-rudi
Copy link
Author

opa-rudi commented Apr 27, 2023

Exported svg and screenshot from canvas. You can see that 2 circles are missing in the svg. I used a Samsung A50 smartphone. On a MacBook this does not happen. Curiously it is drawn on the canvas and not in the svg. It drove me crazy last night. I will do a litte more research.

signature (7)
Screenshot_20230427-174153_Vivaldi Browser

@opa-rudi
Copy link
Author

I tried on a different smartphone and browser with the same result. So probably you can reproduce it by yourself.

Screenshot_20230427-185518_One UI Home

@UziTech
Copy link
Collaborator

UziTech commented Apr 27, 2023

I have tried many times to reproduce it. It doesn't happen for me. If you could get the data points I could try debugging it.

@opa-rudi
Copy link
Author

opa-rudi commented Apr 28, 2023

Did you tap very quickly to generate circles? I will export a data array for you...

@opa-rudi
Copy link
Author

opa-rudi commented May 1, 2023

data array looks fine, but exported svg not.

Bildschirm­foto 2023-05-01 um 03 16 41

@UziTech
Copy link
Collaborator

UziTech commented May 1, 2023

Can you paste the data here so I can copy it?

@opa-rudi
Copy link
Author

opa-rudi commented May 1, 2023

I did a new one in the previous post. Here is the array for that:
[
{
"penColor": "black",
"dotSize": 0,
"minWidth": 0.5,
"maxWidth": 2.5,
"velocityFilterWeight": 0.7,
"points": [
{
"time": 1682903762076,
"x": 70.58169555664062,
"y": 49.69459533691406,
"pressure": 0.5
}
]
},
{
"penColor": "black",
"dotSize": 0,
"minWidth": 0.5,
"maxWidth": 2.5,
"velocityFilterWeight": 0.7,
"points": [
{
"time": 1682903762230,
"x": 122.27616882324219,
"y": 58.09330749511719,
"pressure": 0.5
}
]
},
{
"penColor": "black",
"dotSize": 0,
"minWidth": 0.5,
"maxWidth": 2.5,
"velocityFilterWeight": 0.7,
"points": [
{
"time": 1682903762400,
"x": 134.39480590820312,
"y": 58.76930236816406,
"pressure": 0.5
},
{
"time": 1682903762486,
"x": 159.71324157714844,
"y": 61.18104553222656,
"pressure": 0.5
}
]
},
{
"penColor": "black",
"dotSize": 0,
"minWidth": 0.5,
"maxWidth": 2.5,
"velocityFilterWeight": 0.7,
"points": [
{
"time": 1682903762552,
"x": 206.69993591308594,
"y": 68.80174255371094,
"pressure": 0.5
},
{
"time": 1682903762649,
"x": 213.41241455078125,
"y": 71.71488952636719,
"pressure": 0.5
}
]
},
{
"penColor": "black",
"dotSize": 0,
"minWidth": 0.5,
"maxWidth": 2.5,
"velocityFilterWeight": 0.7,
"points": [
{
"time": 1682903762707,
"x": 238.54481506347656,
"y": 75.45240783691406,
"pressure": 0.5
},
{
"time": 1682903762792,
"x": 245.17222595214844,
"y": 74.35498046875,
"pressure": 0.5
}
]
},
{
"penColor": "black",
"dotSize": 0,
"minWidth": 0.5,
"maxWidth": 2.5,
"velocityFilterWeight": 0.7,
"points": [
{
"time": 1682903762864,
"x": 277.57354736328125,
"y": 72.26296997070312,
"pressure": 0.5
}
]
},
{
"penColor": "black",
"dotSize": 0,
"minWidth": 0.5,
"maxWidth": 2.5,
"velocityFilterWeight": 0.7,
"points": [
{
"time": 1682903763023,
"x": 305.44012451171875,
"y": 76.86459350585938,
"pressure": 0.5
},
{
"time": 1682903763100,
"x": 311.1852111816406,
"y": 77.54058837890625,
"pressure": 0
}
]
},
{
"penColor": "black",
"dotSize": 0,
"minWidth": 0.5,
"maxWidth": 2.5,
"velocityFilterWeight": 0.7,
"points": [
{
"time": 1682903763189,
"x": 343.868408203125,
"y": 77.73008728027344,
"pressure": 0.5
}
]
},
{
"penColor": "black",
"dotSize": 0,
"minWidth": 0.5,
"maxWidth": 2.5,
"velocityFilterWeight": 0.7,
"points": [
{
"time": 1682903763345,
"x": 356.86761474609375,
"y": 77.73008728027344,
"pressure": 0.5
}
]
},
{
"penColor": "black",
"dotSize": 0,
"minWidth": 0.5,
"maxWidth": 2.5,
"velocityFilterWeight": 0.7,
"points": [
{
"time": 1682903763486,
"x": 381.2281188964844,
"y": 80.11546325683594,
"pressure": 0.5
}
]
}
]

@UziTech
Copy link
Collaborator

UziTech commented May 1, 2023

It looks like the svg is the same as loading the canvas with fromData

image
image

@UziTech
Copy link
Collaborator

UziTech commented May 1, 2023

I wonder if this isn't a bug in toSvg but a race condition when adding points.

@opa-rudi
Copy link
Author

opa-rudi commented May 1, 2023

I do not understand. What´s a race condition? I wonder why this does not happen to you. I tried it with 2 different smartphones and a Macbook and was able to reproduce it with all devices.

@UziTech
Copy link
Collaborator

UziTech commented May 1, 2023

A race condition is when two events happen fast and the order of events gets mixed up. For example when adding two dots to the canvas signature_pad expects the events to come in as "begin dot 1", "end dot 1", "begin dot 2", "end dot 2". If the dots are added very fast the events might be able to come in as "begin dot 1", "begin dot 2", "end dot 1", "end dot 2". That would be a race condition.

Most likely I am not able to recreate it because my phone is fast enough to call the events in the right order. You said at the beginning that this seems to happen with slower processor speeds.

What we need to figure out is how to get signature_pad to do the correct thing when these events come in out of order.

@opa-rudi
Copy link
Author

opa-rudi commented May 2, 2023

Ok, got that. That sounds plausible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants