pencil-js/pencil.js

Should Line/Polygon/Path points be absolute or relative to position ?

GMartigny opened this issue · 2 comments

Points of a Line object have absolute position. That way, in order to draw a polygon between 3 shapes, it's easy to write:

const line = new Polygon([
	shape1.position,
	shape2.position,
	shape3.position,
]);

This means that moving one position don't change the others.

In the other hand, relative position could allow to move the polygon position and keep the polygon shape.

Relatives points allow shapes to be easily draggable by only modifying shape's position.

Fixed by f750ca8