Skip to content

Polygon/Polyline tool: touch input moves previous point instead of adding new point #575

@hnc-tfshlee

Description

@hnc-tfshlee

When using the polygon or polyline drawing tool on a mobile touch device, tapping a new position to add the next point moves the previous point instead of creating a new one.

Steps to Reproduce

Open any PDF document on a mobile device (touch input)
Select the polygon or polyline tool
Tap and drag to place the first point (P1), then lift finger
Tap at a new position (P2) to add the next line segment
Expected Behavior

Lifting the finger should finalize P1's position. Tapping at P2 should add a new point, creating a line segment from P1 to P2.

Actual Behavior

Tapping at P2 moves the previous point (P1) to the P2 position instead of adding a new point. The point is never finalized on pointerup.

Root Cause Analysis

The polygon/polyline handler appears to be designed around the mouse interaction model, where hover (pointer movement without pointerdown) provides a preview of the next line segment. On touch devices, there is no hover state — every interaction starts with pointerdown, making it impossible to distinguish between "move existing point" and "add new point" using the same event model.

Suggested Improvement

Consider adding touch-specific handling for multi-point drawing tools, for example:

Treat every new pointerdown (after pointerup) as a new point addition rather than a point move
Use long-press to enter point adjustment mode
Or any other gesture differentiation that works for both mouse and touch inputs
Environment

EmbedPDF version: 2.8.0
Platform: Mobile WebView (iOS WKWebView / Android WebView)
Input: Touch (no mouse/stylus)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions