+ [task#127424] add getCanvasSize function of think3c widget.

This commit is contained in:
wangzemei
2024-09-05 16:39:53 +08:00
committed by 刘刚
parent a7db5ec52e
commit 024c17907c
+17
View File
@@ -61,3 +61,20 @@ function binarizeImage(imageData)
imageData.data = pixels;
return imageData;
}
/**
* 获取画布尺寸。
* Get canvas size.
*
* @param number width
* @param number height
* @access public
* @return object
*/
function getCanvasSize(width = 0, height = 0)
{
const maxWidth = $('.think-model-content').length ? ($('.think-model-content').width() - 50) : 400;
const maxHeight = maxWidth;
return {width, height};
}