+ [task#127424] add getCanvasSize function of think3c widget.
This commit is contained in:
@@ -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};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user