-
Notifications
You must be signed in to change notification settings - Fork 3
Zoom and resize
Sonia Zorba edited this page Nov 7, 2015
·
1 revision
There are 2 zoom functions:
-
sky.zoom(zoomFactor)
: zoom the sphere multiplying the current radius to the zoomFactor; -
sky.absoluteZoom(zoomFactor)
: zoom the sphere relying on its initial radius.
Canvas and its content can be resized using:
sky.setContainerSize(width, height, resize, paddingPercentage)
Parameters:
- width: new width of the container in pixel;
- height: new height of the container in pixel;
- resize: optional boolean to indicate if we want to adapt the sphere to the container size after container resizing.
- paddingPercentage percentage (from 0 to 1) of canvas size to leave empty between sphere and container border.
WARNING: to avoid problems with canvas use always this function to resize it and don't set its dimensions by css. For more info read this stackoverflow.com question.