fix: restore PDF pen capture and overhaul sticky/pens/pages
All checks were successful
CI / Windows build (push) Successful in 9m55s

Reinstall PenCaptureBinding so stylus ink hits again; keep finger Listener translucent under pinch; page-anchor sticky with drag/resize; OneNote pen slots (brush+width+color); blank-note multi-page; default side button to hold-select-text.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-07 02:38:58 +08:00
parent ad9b1b46db
commit 307161f465
16 changed files with 1279 additions and 487 deletions

View File

@@ -85,6 +85,8 @@ class PenCanvas extends StatefulWidget {
this.allowFingerDrawing = false,
this.minScale = 0.5,
this.maxScale = 8.0,
this.scaleEnabled = true,
this.panEnabled = true,
this.onPenDebug,
this.thinning = kDefaultPenThinning,
this.pressureGamma = kNaturalPressureGamma,
@@ -163,6 +165,13 @@ class PenCanvas extends StatefulWidget {
final double minScale;
final double maxScale;
/// When false, the canvas cannot be pinch-zoomed (sticky notes lock this so
/// writing isn't fighting an inner transform).
final bool scaleEnabled;
/// When false, one-finger pan is disabled (sticky notes often lock pan too).
final bool panEnabled;
/// perfect_freehand pressure→width response, from `PenConfig.pressureSensitivity`.
final double thinning;
@@ -804,7 +813,7 @@ class _PenCanvasState extends State<PenCanvas> {
// governs touch/mouse: suppress pan while a single-finger / mouse stroke is
// in progress (finger-drawing mode); a 2nd pointer cancels the stroke first
// so a pinch re-enables pan/zoom immediately.
final panEnabled = _drawPointer == null;
final panEnabled = widget.panEnabled && _drawPointer == null;
// Mirror committed strokes into the revision-tracked store (only re-mirrors
// when the parent handed us a new list identity).
@@ -823,7 +832,7 @@ class _PenCanvasState extends State<PenCanvas> {
minScale: widget.minScale,
maxScale: widget.maxScale,
panEnabled: panEnabled,
scaleEnabled: true,
scaleEnabled: widget.scaleEnabled,
child: SizedBox(
width: widget.pageSize.width,
height: widget.pageSize.height,