VectorDrawable is not center aligned

后端 未结 5 1438
鱼传尺愫
鱼传尺愫 2021-02-04 09:31

I\'ve created a VectorDrawable file with the path data i had. But the issue is that image is not aligning at the centre of the total area and instead it\'s created as top-left a

5条回答
  •  Happy的楠姐
    2021-02-04 10:12

    You could accomplish this by adjusting the x and y value of the M at the beginning of your path data.

    I'm not suggesting this is better than , but it is an alternative solution which I have found helpful in some situations.

    Original Path:

    
    

    Same path adjusted 100 right and 200 down:

    
    

    NOTE: other answers have already indicated ways to calculate the correct amount of X and Y to adjust, this answer only indicates another way to implement an adjustment.

提交回复
热议问题