0

I want to create a grid of draggable lines. Once I create the grid, I'd like to be able to get the width and height of each region.

example: 1 vertical line and 1 horizontal would create 4 regions.

Using FabricJs, I'm able to create my lines, I'm able to drag left and right, up and down, but I'm not sure how to get the width and height for each region.

I was trying to see how the code worked on this link, but I can't quite grasp it: Detecting Regions Described by Lines on HTML5 Canvas

Stoops
  • 21
  • 1
  • 3
  • 1
    Share your logic? – Yogen Darji Aug 14 '17 at 16:55
  • do you need to work with horizontal/vertical only? – AndreaBogazzi Aug 16 '17 at 08:16
  • Correct. Only horizontal and vertical. Once I have the lines drawn in, I can easily get the x,y for each line. My problem is grasping the function that will run thru each line(x,y) and give me the width and height for each region it created. (When I say region, I'm talking about the section a line will create. Say I wanted 2 columns and 2 rows. i would use 1 horizontal line to cut it in half, then a vertical line to cut it in half. This would give me 4 regions.) – Stoops Aug 16 '17 at 14:41

0 Answers0