cdglabs / apparatus

A hybrid graphics editor and programming environment for creating interactive diagrams.

Home Page:http://aprt.us/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Improve canvas grid and zooming behavior

thachmai opened this issue · comments

The canvas grid is currently fixed from [-10,-10] to [10,10] with the grid lines always visible.

Zooming is currently not restricted in anyway. You can manage to "lose" the position of the grid by accident.

Some additions to the current behavior could improve usability:

  • Ability to the turn grid on/off.
  • A strong gridline for 10s of units. A less visible line for single increments.
  • Show the grid for the whole canvas.
  • Constraint the zoom and panning to a restricted plane: either [-100,-100] to [100,100] or double the size of the current sketch, whichever is larger.

Great. You'll see there's a hack to hide the grid; I quickly put this in because I needed it for a presentation. But I think this visibility state should just be in the Layout model that you made for #24.

As for the button to toggle visibility of the grid, the menubar is starting to get crowded. We can put an icon next to the full screen icon I guess.

Your suggestions in bullet points 2 and 3 sound good.

4 sounds good too. Finding the size of the current sketch takes a bit more work. We need to be able to determine the "bounding box" for a diagram. I have wanted to do this so that we could show the create panel thumbnails nicely cropped. To do this, we should add a method boundingBox to Graphic. So a graphic can render, hit detect, or figure out its bounding box.

I would say 1-3 are a good unit of work. 4, along with the bounding box implementation, should be its own PR.