diff --git a/apps/pdfeditor/main/app/controller/Toolbar.js b/apps/pdfeditor/main/app/controller/Toolbar.js index a694382247..e9149fe76e 100644 --- a/apps/pdfeditor/main/app/controller/Toolbar.js +++ b/apps/pdfeditor/main/app/controller/Toolbar.js @@ -1171,16 +1171,22 @@ define([ var arr = this.api.asc_getPropertyEditorStamps(), template = _.template([ '', - '', + '
', '
' ].join('')); arr.forEach(function(item){ var menuItem = new Common.UI.MenuItem({ value: item.Type, - stampImage: item.Image, + itemWidth: item.Image.width/Common.Utils.applicationPixelRatio(), + itemHeight: item.Image.height/Common.Utils.applicationPixelRatio(), template: template }); menu.addItem(menuItem, true); + if (menuItem.cmpEl) { + menuItem.cmpEl.find('div').append(item.Image); + menuItem.cmpEl.find('canvas').css({width: '100%', height: '100%'}); + } + }); this.toolbar.btnStamp.options.stampType = arr[0].Type; } diff --git a/apps/pdfeditor/main/app/view/Toolbar.js b/apps/pdfeditor/main/app/view/Toolbar.js index 90128b37b1..0ea8f93d1b 100644 --- a/apps/pdfeditor/main/app/view/Toolbar.js +++ b/apps/pdfeditor/main/app/view/Toolbar.js @@ -1519,6 +1519,16 @@ define([ me.btnStamp.setMenu(new Common.UI.Menu({ restoreHeight: 500 })); + var menu = me.btnStamp.menu; + if (menu.cmpEl) { + menu.cmpEl.attr('ratio', 'ratio'); + menu.cmpEl.on('app:scaling', function (e, info) { + if ( me.options.scaling != info.ratio ) { + menu.hide(); + menu.removeAll(); + } + }); + } } }); },