0

Is there a way to zoom extents of a collection of shapes without computing min/max xy's and wh's - very painful when sloping lines are involved. enter image description here

Perhaps some kind of pixel detection?

Chris Glasier
  • 791
  • 2
  • 10
  • 21
  • Can you elaborate on your question? It doesn't make much sense. Try posting some code of what you have tried and what you are having trouble with. jsfiddles and the like are appreciated. – SoluableNonagon Feb 14 '13 at 14:33
  • Better I think to reduce it to 'how to set the bottom right xy of the pink overlay so that all lines and shapes are shown highlighted.' For example, the rh x in the above is determined by the x of the last red wagon. If the wagons more away the rh x will more to the x of the track they were sitting on. I was just hoping there was a simple way to find the extreme x and y so I can get the ratios right between screens of different sizes – Chris Glasier Feb 14 '13 at 21:22
  • If you are looking for how to determine the width of your overlay simply use built in javascript. you can do stage.setWidth(window.innerWidth); If you are trying to zoom you should do stage.setScale(x,y); Also, you are referencing terms that only you know. You have not given any information about your code, what wagons and tracks are in your code, etc. – SoluableNonagon Feb 14 '13 at 21:54
  • Thanks. What I envisaged was something like div.offsetWidth - like stage.getAbsoluteWidth but it does not exist (yet). All the other stuff is fine, the problem is the stage does not expand. – Chris Glasier Feb 14 '13 at 22:29

0 Answers0