OLD | NEW |
1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 * Use of this source code is governed by a BSD-style license that can be | 2 * Use of this source code is governed by a BSD-style license that can be |
3 * found in the LICENSE file. | 3 * found in the LICENSE file. |
4 */ | 4 */ |
5 'use strict'; | 5 'use strict'; |
6 | 6 |
7 base.require('base.range'); | 7 base.require('base.range'); |
8 base.require('ui.event_target'); | 8 base.require('ui.event_target'); |
9 | 9 |
10 base.exportTo('ccfv', function() { | 10 base.exportTo('ccfv', function() { |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 var world_pad; | 72 var world_pad; |
73 if (opt_dontPadBbox) { | 73 if (opt_dontPadBbox) { |
74 world_pad = 0; | 74 world_pad = 0; |
75 } else { | 75 } else { |
76 world_pad = Math.min(world_rect.width, | 76 world_pad = Math.min(world_rect.width, |
77 world_rect.height) * 0.10; | 77 world_rect.height) * 0.10; |
78 } | 78 } |
79 | 79 |
80 world_rect.enlarge(world_pad); | 80 world_rect.enlarge(world_pad); |
81 this.worldRect = world_rect; | 81 this.worldRect = world_rect; |
| 82 this.updateScale_(); |
82 this.updateTransform_(); | 83 this.updateTransform_(); |
83 this.didChange_(); | 84 this.didChange_(); |
84 }, | 85 }, |
85 | 86 |
86 updateTransform_: function() { | 87 updateTransform_: function() { |
87 if (!this.transformWorldToDevicePixels_) | 88 if (!this.transformWorldToDevicePixels_) |
88 return; | 89 return; |
89 | 90 |
90 mat2d.identity(this.transformWorldToDevicePixels_); | 91 mat2d.identity(this.transformWorldToDevicePixels_); |
91 mat2d.translateInplaceXY( | 92 mat2d.translateInplaceXY( |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 didChange_: function() { | 134 didChange_: function() { |
134 base.dispatchSimpleEvent(this, 'change', false, false); | 135 base.dispatchSimpleEvent(this, 'change', false, false); |
135 } | 136 } |
136 }; | 137 }; |
137 | 138 |
138 return { | 139 return { |
139 QuadViewViewport: QuadViewViewport, | 140 QuadViewViewport: QuadViewViewport, |
140 } | 141 } |
141 }); | 142 }); |
142 | 143 |
OLD | NEW |