Revize d7508af3
Přidáno uživatelem Pavel Fidranský před více než 6 roky(ů)
sources/src/main/webapp/js/components/minimap.js | ||
---|---|---|
13 | 13 |
|
14 | 14 |
/** |
15 | 15 |
* Resizes the minimap viewport using current viewport size and minimap scale. |
16 |
* @param {object} size Object holding current dimensions of the viewport component.
|
|
16 |
* @param {Dimensions} dimensions Object holding current dimensions of the viewport component.
|
|
17 | 17 |
*/ |
18 |
this.setViewportSize = function(size) {
|
|
19 |
viewportElement.setAttribute('width', size.width * scale);
|
|
20 |
viewportElement.setAttribute('height', size.height * scale);
|
|
18 |
this.setViewportSize = function(dimensions) {
|
|
19 |
viewportElement.setAttribute('width', dimensions.width * scale);
|
|
20 |
viewportElement.setAttribute('height', dimensions.height * scale);
|
|
21 | 21 |
}; |
22 | 22 |
|
23 | 23 |
/** |
sources/src/main/webapp/js/components/viewport.js | ||
---|---|---|
104 | 104 |
}; |
105 | 105 |
|
106 | 106 |
this.getSize = function() { |
107 |
return {
|
|
108 |
'width': rootElement.offsetWidth,
|
|
109 |
'height': rootElement.offsetHeight,
|
|
110 |
};
|
|
107 |
return new Dimensions(
|
|
108 |
rootElement.offsetWidth, |
|
109 |
rootElement.offsetHeight, |
|
110 |
);
|
|
111 | 111 |
}; |
112 | 112 |
|
113 | 113 |
this.getPosition = function() { |
sources/src/main/webapp/js/valueObjects/dimensions.js | ||
---|---|---|
1 |
/** |
|
2 |
* Class representing a dimensions pair. |
|
3 |
* @constructor |
|
4 |
* @param {float} width Width dimension. |
|
5 |
* @param {float} height Height dimension. |
|
6 |
*/ |
|
7 |
function Dimensions(width, height) { |
|
8 |
/** @prop {float} width Width dimension. */ |
|
9 |
this.width = width; |
|
10 |
/** @prop {float} height Height dimension. */ |
|
11 |
this.height = height; |
|
12 |
} |
sources/src/main/webapp/showGraph.jsp | ||
---|---|---|
53 | 53 |
|
54 | 54 |
<script src="js/valueObjects/coordinates.js"></script> |
55 | 55 |
<script src="js/valueObjects/diagram.js"></script> |
56 |
<script src="js/valueObjects/dimensions.js"></script> |
|
56 | 57 |
|
57 | 58 |
<script src="js/userMenu.js"></script> |
58 | 59 |
<script src="js/markSymbol.js"></script> |
Také k dispozici: Unified diff
created Dimensions JS class