aprsworld / wsWebDisplay

0 stars 0 forks source link

snap to grid on resize #68

Closed Cdetviler closed 8 years ago

Cdetviler commented 8 years ago

Only apply this to text-based elements

Cdetviler commented 8 years ago

Right now I have it so that it is snapping every 5,10,25,50 or 100 pixels (whatever is specified by the grid) but it is snapping at its existing width and positioning. so if it is positioned at top: 37 and left 42 and the grid size is 50, it snaps to 87 and 92. I was trying to use the same algorithm for resizing that I used for dragging, but dragging only needed to take into account the top and left coordinates - not the width or height. I will have to come up with something better. For now it is staying non-snappable because it is proving to be frustrating the way that I have it right now. I will come up with a better solution next week

Cdetviler commented 8 years ago

Grid resizing has been added. There is a slight stutter when resizing with the west, northwest, and north resize-handles. This happens when the left or bottom edge of the element is not lined up with the grid which happens when the element is initially placed. I think this could be solved by matching the element's width and height to the nearest grid size when the element is created.

Cdetviler commented 8 years ago

Fixed the issue in the latest commit