File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
src/DrawTogether.Actors/Local Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ public class StrokeContinuityStage : GraphStage<
2525 private readonly TimeSpan _userInactivityTimeout ;
2626 private const string UserInactivityTimeout = "user-inactivity-timeout" ;
2727 private readonly TimeSpan _strokeDisconnectTimeout = TimeSpan . FromMilliseconds ( 200 ) ;
28+ private const double StrokeDisconnectDistance = 250.0 ; // pixels
2829
2930 // Shape definition for this stage
3031 public override FlowShape < ImmutableList < LocalPaintProtocol . IPaintSessionMessage > , IEnumerable < ConnectedStroke > >
@@ -161,7 +162,7 @@ private IEnumerable<ConnectedStroke> ProcessBatch(ImmutableList<LocalPaintProtoc
161162 // something unusual happened (e.g., user clicked somewhere else) - no need for continuity
162163 var distance = CalculateDistance ( activeInfo . LastPoint , pointsToAdd [ 0 ] ) ;
163164
164- if ( distance <= 50.0 ) // Threshold for what we consider "continuous"
165+ if ( distance <= StrokeDisconnectDistance ) // Threshold for what we consider "continuous"
165166 {
166167 // For perfect continuity, replace the first point with the last point from previous stroke
167168 // This ensures there's not even a sub-pixel gap between strokes
You can’t perform that action at this time.
0 commit comments