Commit 0eb5142 1 parent 7199054 commit 0eb5142 Copy full SHA for 0eb5142
File tree 5 files changed +21
-18
lines changed
g-plugin-device-renderer/src/meshes
5 files changed +21
-18
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' @antv/g-plugin-zdog-canvas-renderer ' : patch
3
+ ' @antv/g-plugin-device-renderer ' : patch
4
+ ' @antv/g-plugin-webgpu-device ' : patch
5
+ ' @antv/g-plugin-webgl-device ' : patch
6
+ ' @antv/g-plugin-box2d ' : patch
7
+ ' @antv/g-plugin-physx ' : patch
8
+ ' @antv/g-webgpu ' : patch
9
+ ' @antv/g-lite ' : patch
10
+ ---
11
+
12
+ Avoid overriding defXY when parsing path
Original file line number Diff line number Diff line change @@ -757,8 +757,10 @@ export class DefaultStyleValueRegistry implements StyleValueRegistry {
757
757
object . parsedStyle . path = parsePath (
758
758
// @ts -ignore
759
759
attributes . path ,
760
- object ,
761
760
) ;
761
+
762
+ object . parsedStyle . defX = object . parsedStyle . path . rect . x ;
763
+ object . parsedStyle . defY = object . parsedStyle . path . rect . y ;
762
764
}
763
765
// Text
764
766
if ( attributes . textTransform ) {
Original file line number Diff line number Diff line change @@ -9,10 +9,7 @@ import {
9
9
path2Curve ,
10
10
reverseCurve ,
11
11
} from '@antv/util' ;
12
- import type {
13
- DisplayObject ,
14
- ParsedPathStyleProps ,
15
- } from '../../display-objects' ;
12
+ import type { ParsedPathStyleProps } from '../../display-objects' ;
16
13
import type { IElement } from '../../dom' ;
17
14
import { memoize } from '../../utils/memoize' ;
18
15
import {
@@ -82,18 +79,10 @@ const memoizedParsePath = memoize(internalParsePath);
82
79
83
80
export function parsePath (
84
81
path : string | PathArray ,
85
- object ?: DisplayObject ,
86
82
) : ParsedPathStyleProps [ 'path' ] {
87
- const result = (
83
+ return (
88
84
isString ( path ) ? memoizedParsePath ( path ) : internalParsePath ( path )
89
85
) as ParsedPathStyleProps [ 'path' ] ;
90
-
91
- if ( object ) {
92
- object . parsedStyle . defX = result . rect . x ;
93
- object . parsedStyle . defY = result . rect . y ;
94
- }
95
-
96
- return result ;
97
86
}
98
87
99
88
export function mergePaths (
Original file line number Diff line number Diff line change @@ -48,6 +48,9 @@ export class CSSPropertyPath
48
48
* update local position
49
49
*/
50
50
postProcessor ( object : DisplayObject , attributes : string [ ] ) {
51
+ object . parsedStyle . defX = object . parsedStyle . path . rect . x ;
52
+ object . parsedStyle . defY = object . parsedStyle . path . rect . y ;
53
+
51
54
if (
52
55
object . nodeName === Shape . PATH &&
53
56
attributes . indexOf ( 'transform' ) === - 1
Original file line number Diff line number Diff line change @@ -484,10 +484,7 @@ export function updateBuffer(
484
484
) {
485
485
let path : ParsedPathStyleProps [ 'path' ] ;
486
486
if ( object . nodeName !== Shape . PATH ) {
487
- path = parsePath (
488
- convertToPath ( object , mat4 . identity ( mat4 . create ( ) ) ) ,
489
- object ,
490
- ) ;
487
+ path = parsePath ( convertToPath ( object , mat4 . identity ( mat4 . create ( ) ) ) ) ;
491
488
defX = path . rect . x ;
492
489
defY = path . rect . y ;
493
490
You can’t perform that action at this time.
0 commit comments