Skip to content

Figure out a different reference point for buffering #5

@skeate

Description

@skeate

Right now, this is essentially the algorithm:

  1. User mousedowns on a shape. Calculate (rough) centroid of shape, and distance (d1) of mouse location to the centroid.
  2. As mouse moves, calculate distance of mouse position to centroid (d2)
  3. d2-d1 is the amount to adjust the buffering radius

Some things happen with this:

  1. If you shrink far enough, the centroid will often wind up completely outside the convex hull of the shape. This makes further shrinkage awkward, since you are dragging to some point outside of the shape but it still shrinks.
  2. If you drag from near the end of a long, skinny shape, you can produce a very negative radius (consider a 500x5 rectangle; if you start dragging from (0,3) you can wind up with a -250 radius once you reach the centroid, which of course is way more than you need for the shape to completely disappear)

Perhaps scaling motion relative to the bounding rectangle? Should solve 2 at least.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions