简体   繁体   English

更新画布而不悬停

[英]Updating canvas without hovering

I'm making something like MS Paint using jCanvas library. 我正在使用jCanvas库制作类似于MS Paint的东西。 I've put a button OUTSIDE the canvas. 我在画布外放了一个按钮。 The button rotates the selected layer clockwise but I can't see any change unless I hover the canvas with mouse. 该按钮顺时针旋转所选图层,但是除非用鼠标悬停画布,否则看不到任何更改。 I want the layer to be rotated by the time I press the button. 我希望在按下按钮时旋转图层。

I tried using restoreCanvas() function but it didnt't work. 我尝试使用restoreCanvas()函数,但是没有用。 How can I make a canvas automatically refreshed when a button out of it is pressed? 按下画布上的按钮后,如何使画布自动刷新?

Sorry for bad English. 对不起,英语不好。

Solved. 解决了。 This function refreshes the canvas: $('canvas').drawLayers(); 此函数刷新画布:$('canvas')。drawLayers();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM