-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e753718
commit fbdc997
Showing
4 changed files
with
38 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -178,6 +178,7 @@ class ServersPlugin { | |
'extensionType', | ||
'extension', | ||
'verticalAlign', | ||
'roundValue', | ||
]; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* @Author: wuchenguang1998 | ||
* @Date: 2024-07-28 22:00:00 | ||
* @LastEditors: wuchenguang1998 | ||
* @LastEditTime: 2024-07-28 23:00:00 | ||
* @Description: 矩形元素,圆角属性适配元素放缩影响 | ||
*/ | ||
import { fabric } from 'fabric'; | ||
|
||
fabric.Rect = fabric.util.createClass(fabric.Rect, { | ||
type: 'rect', | ||
initialize: function (options) { | ||
options || (options = {}); | ||
this.callSuper('initialize', options); | ||
}, | ||
_render(ctx) { | ||
const roundValue = this.roundValue || 0; | ||
this.rx = (1 / this.scaleX) * roundValue; | ||
this.ry = (1 / this.scaleY) * roundValue; | ||
this.callSuper('_render', ctx); | ||
}, | ||
}); | ||
|
||
fabric.Rect.fromObject = function (object, callback) { | ||
return fabric.Object._fromObject('Rect', object, callback); | ||
}; | ||
|
||
export default fabric.Rect; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters