(thumbnailModel: ThumbnailModel, ecModel: GlobalModel, api: ExtensionAPI)
| 62 | private _renderVersion: number; |
| 63 | |
| 64 | render(thumbnailModel: ThumbnailModel, ecModel: GlobalModel, api: ExtensionAPI): void { |
| 65 | this._api = api; |
| 66 | this._model = thumbnailModel; |
| 67 | if (!this._coordSys) { |
| 68 | this._coordSys = new View(); |
| 69 | } |
| 70 | |
| 71 | if (!this._isEnabled()) { |
| 72 | this._clear(); |
| 73 | return; |
| 74 | } |
| 75 | |
| 76 | this._renderVersion = api.getECUpdateCycleVersion(); |
| 77 | const group = this.group; |
| 78 | |
| 79 | group.removeAll(); |
| 80 | |
| 81 | const itemStyleModel = thumbnailModel.getModel('itemStyle'); |
| 82 | const itemStyle = itemStyleModel.getItemStyle(); |
| 83 | if (itemStyle.fill == null) { |
| 84 | itemStyle.fill = ecModel.get('backgroundColor') || tokens.color.neutral00; |
| 85 | } |
| 86 | |
| 87 | const refContainer = createBoxLayoutReference(thumbnailModel, api).refContainer; |
| 88 | const boxRect = getLayoutRect( |
| 89 | getBoxLayoutParams(thumbnailModel, true), |
| 90 | refContainer |
| 91 | ); |
| 92 | const boxBorderWidth = itemStyle.lineWidth || 0; |
| 93 | const contentRect = this._contentRect = expandOrShrinkRect( |
| 94 | boxRect.clone(), boxBorderWidth / 2, true, true |
| 95 | ); |
| 96 | |
| 97 | const contentGroup = new Group(); |
| 98 | group.add(contentGroup); |
| 99 | contentGroup.setClipPath(new Rect({shape: contentRect.plain()})); |
| 100 | |
| 101 | const targetGroup = this._targetGroup = new Group(); |
| 102 | contentGroup.add(targetGroup); |
| 103 | |
| 104 | // Draw border and background and shadow of thumbnail box. |
| 105 | const borderShape: RectShape = boxRect.plain(); |
| 106 | borderShape.r = itemStyleModel.getShallow('borderRadius', true) as (number | number[]); |
| 107 | group.add(this._bgRect = new Rect({ |
| 108 | style: itemStyle, |
| 109 | shape: borderShape, |
| 110 | silent: false, // Prevent from hovering on the lower elements. |
| 111 | cursor: 'grab', |
| 112 | })); |
| 113 | |
| 114 | const windowStyleModel = thumbnailModel.getModel('windowStyle'); |
| 115 | const windowR = windowStyleModel.getShallow('borderRadius', true) as (number | number[]); |
| 116 | contentGroup.add(this._windowRect = new Rect({ |
| 117 | shape: {x: 0, y: 0, width: 0, height: 0, r: windowR}, |
| 118 | style: windowStyleModel.getItemStyle(), |
| 119 | silent: false, // Prevent from hovering on the lower elements. |
| 120 | cursor: 'grab', |
| 121 | })); |
nothing calls this directly
no test coverage detected