@@ -625,6 +625,9 @@ export default class PixiStage {
625625 thisFigureContainer . zIndex = metadata . zIndex ;
626626 }
627627 }
628+
629+ thisFigureContainer . pivot . set ( 0 , this . stageHeight / 2 ) ;
630+
628631 // 挂载
629632 this . figureContainer . addChild ( thisFigureContainer ) ;
630633 this . figureObjects . push ( {
@@ -668,16 +671,26 @@ export default class PixiStage {
668671
669672 model . scale . set ( targetScale ) ;
670673 model . anchor . set ( 0.5 ) ;
671- model . position . x = stageWidth / 2 ;
672- model . position . y = stageHeight / 1.2 ;
673674
674- if ( pos === 'left' ) {
675- model . position . x = targetWidth / 2 ;
675+ const targetHeight = model . height * targetScale ;
676+
677+ let baseY = stageHeight / 2 ;
678+ if ( targetHeight < stageHeight ) {
679+ baseY = stageHeight / 2 + ( stageHeight - targetHeight ) / 2 ;
676680 }
677- if ( pos === 'right' ) {
678- model . position . x = stageWidth - targetWidth / 2 ;
681+ thisFigureContainer . setBaseY ( baseY ) ;
682+
683+ if ( pos === 'center' ) {
684+ thisFigureContainer . setBaseX ( stageWidth / 2 ) ;
685+ } else if ( pos === 'left' ) {
686+ thisFigureContainer . setBaseX ( targetWidth / 2 ) ;
687+ } else if ( pos === 'right' ) {
688+ thisFigureContainer . setBaseX ( stageWidth - targetWidth / 2 ) ;
679689 }
680690
691+ model . position . x = 0 ;
692+ model . position . y = stageHeight / 1.2 ;
693+
681694 let motionToSet = motion ;
682695 let animation_index = 0 ;
683696 let priority_number = 3 ;
0 commit comments