Javascript 比率:函数(){ if(窗口中的“devicePixelRatio”){ 如果(window.devicePixelRatio>1){ 返回窗口.devicePixelRatio; } } 返回1; }, 就绪:函数(){ var事件=[ //基本事件 "

Javascript 比率:函数(){ if(窗口中的“devicePixelRatio”){ 如果(window.devicePixelRatio>1){ 返回窗口.devicePixelRatio; } } 返回1; }, 就绪:函数(){ var事件=[ //基本事件 ",javascript,html,canvas,polymer,Javascript,Html,Canvas,Polymer,比率:函数(){ if(窗口中的“devicePixelRatio”){ 如果(window.devicePixelRatio>1){ 返回窗口.devicePixelRatio; } } 返回1; }, 就绪:函数(){ var事件=[ //基本事件 "倒",, "起来",, “轨道启动”, “轨道”, “trackend”, "水龙头",, “等等”, “保持脉冲”, “释放” ]; this.init(); events.forEach(函数(en){ PolymerGestures.ad

比率:函数(){ if(窗口中的“devicePixelRatio”){ 如果(window.devicePixelRatio>1){ 返回窗口.devicePixelRatio; } } 返回1; }, 就绪:函数(){ var事件=[ //基本事件 "倒",, "起来",, “轨道启动”, “轨道”, “trackend”, "水龙头",, “等等”, “保持脉冲”, “释放” ]; this.init(); events.forEach(函数(en){ PolymerGestures.addEventListener(此,en,函数(inEvent){ var coords=this.getCoords(inEvent); 开关(en){ 案例“关闭”: this.fire('mycustom-canvas-down',{event:inEvent,x:coords.x,y:coords.y}); 打破 “轨道”案例: this.fire('mycustom-canvas-track',{event:inEvent,x:coords.x,y:coords.y}); 打破 案例“向上”: this.fire('mycustom-canvas-up',{event:inEvent,x:coords.x,y:coords.y}); 打破 } inEvent.preventDefault(); }); },这个); }, domReady:function(){ this.async('resizeHandler'); }, 附:函数(){ 此参数为.resizableAttachedHandler(); }, 分离:函数(){ this.resizebledetachedhandler(); }, resizeHandler:函数(){ this.init(); 这个.logCanvasSize(); }, logCanvasSize:function(){ log('Canvas width:'+this.$.Canvas.width+'-Canvas height:'+this.$.Canvas.height); } },聚合物。可再塑化);
Polymer团队构建了一个名为
元素的非ui组件,该组件触发一个
核心调整大小
事件,您可以利用该事件调整画布大小。