File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change 1
1
// Fit to Width (cmd shift 1)
2
2
// This plugin will zoom out to fit the canvas' contents in the window,
3
3
// but maximizing the width only
4
- margin = 50
5
- view = [doc currentView]
6
-
7
- window_width = view.frame().size.width
8
- window_height = view.frame().size.height
9
-
10
- layers = doc.currentPage().containedLayers()
11
- layerRect = [view totalRectForLayers:layers]
4
+ var doc = context.document,
5
+ margin = 50,
6
+ view = [doc currentView],
7
+ window_width = view.frame().size.width,
8
+ window_height = view.frame().size.height,
9
+ layers = doc.currentPage().containedLayers(),
10
+ layerRect = [view totalRectForLayers:layers]
12
11
13
12
// Calculate vertical ratio
14
- ratio = window_width / window_height
13
+ var ratio = window_width / window_height
15
14
16
15
// Set rect height to new ratio
17
16
layerRect.size.height = layerRect.size.width / ratio
You can’t perform that action at this time.
0 commit comments