diff options
author | Abyss777 <abyss@fox5.ru> | 2016-11-08 16:01:59 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2016-11-08 16:01:59 +0500 |
commit | dbd7cb8ca62dd7fbc62fbfb9ccc16fc4b8a08d64 (patch) | |
tree | 3da2c9dd90dfb851c04546e9f278b14346edd876 /web/app/DeviceImages.js | |
parent | 7aaa4418b81a9d7686969715198b4b639c263b79 (diff) | |
download | trackermap-web-dbd7cb8ca62dd7fbc62fbfb9ccc16fc4b8a08d64.tar.gz trackermap-web-dbd7cb8ca62dd7fbc62fbfb9ccc16fc4b8a08d64.tar.bz2 trackermap-web-dbd7cb8ca62dd7fbc62fbfb9ccc16fc4b8a08d64.zip |
Changed icon styles
Diffstat (limited to 'web/app/DeviceImages.js')
-rw-r--r-- | web/app/DeviceImages.js | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/web/app/DeviceImages.js b/web/app/DeviceImages.js index 52eea1d0..c79406b0 100644 --- a/web/app/DeviceImages.js +++ b/web/app/DeviceImages.js @@ -39,6 +39,7 @@ Ext.define('Traccar.DeviceImages', { svg.getElementById(device.get('fillId')).style.fill = color; // Prepare rotate transformation rotateTransform = 'rotate(' + angle + ' ' + (width / 2) + ' ' + (height / 2) + ')'; + svg.getElementById(device.get('rotateId')).setAttribute('transform', rotateTransform); // Adjust size and prepare scale transformation width *= device.get('scale'); @@ -51,9 +52,13 @@ Ext.define('Traccar.DeviceImages', { scaleTransform = 'scale(' + device.get('scale') + ') '; } - //Apply both transformation in right order - transform = scaleTransform + ' ' + rotateTransform; - svg.getElementById(device.get('rotateId')).setAttribute('transform', transform); + if (device.get('scaleId') !== device.get('rotateId')) { + svg.getElementById(device.get('scaleId')).setAttribute('transform', scaleTransform); + } else { + svg.getElementById(device.get('scaleId')).setAttribute('transform', scaleTransform + ' ' + rotateTransform); + } + //transform = scaleTransform + ' ' + rotateTransform; + // Set dimension attributes svg.documentElement.setAttribute('width', width); |