File tree Expand file tree Collapse file tree
common/changes/@visactor/vtable Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ {
2+ "changes" : [
3+ {
4+ "packageName" : " @visactor/vtable" ,
5+ "comment" : " fix: fix node-canvas range in PivotChart #3997" ,
6+ "type" : " none"
7+ }
8+ ],
9+ "packageName" : " @visactor/vtable"
10+ }
Original file line number Diff line number Diff line change @@ -4260,8 +4260,24 @@ export abstract class BaseTable extends EventTarget implements BaseTableAPI {
42604260 this . render ( ) ;
42614261 const stage = this . scenegraph . stage ;
42624262 if ( stage ) {
4263- const contentWidth = this . tableX + this . getAllColsWidth ( ) ;
4264- const contentHeight = this . tableY + this . getAllRowsHeight ( ) ;
4263+ let contentWidth = this . tableX + this . getAllColsWidth ( ) ;
4264+ let contentHeight = this . tableY + this . getAllRowsHeight ( ) ;
4265+ if ( this . internalProps . legends ) {
4266+ this . internalProps . legends . forEach ( legend => {
4267+ if ( legend . orient === 'right' ) {
4268+ contentWidth = Math . max ( contentWidth , legend . legendComponent . globalAABBBounds . x2 ) ;
4269+ } else if ( legend . orient === 'bottom' ) {
4270+ contentHeight = Math . max ( contentHeight , legend . legendComponent . globalAABBBounds . y2 ) ;
4271+ }
4272+ } ) ;
4273+ }
4274+ if ( this . internalProps . title ) {
4275+ if ( this . internalProps . title . _titleOption . orient === 'right' ) {
4276+ contentWidth = Math . max ( contentWidth , this . internalProps . title . getComponentGraphic ( ) . globalAABBBounds . x2 ) ;
4277+ } else if ( this . internalProps . title . _titleOption . orient === 'bottom' ) {
4278+ contentHeight = Math . max ( contentHeight , this . internalProps . title . getComponentGraphic ( ) . globalAABBBounds . y2 ) ;
4279+ }
4280+ }
42654281 if ( contentWidth >= this . canvasWidth && contentHeight >= this . canvasHeight ) {
42664282 stage . render ( ) ;
42674283 const buffer = stage . window . getImageBuffer ( type ) ;
You can’t perform that action at this time.
0 commit comments