#Yie-6ren">
gpt4 book ai didi

javascript - Fabric .js : Positioning bug when rotating a group?

转载 作者:行者123 更新时间:2023-11-29 14:51:59 25 4
gpt4 key购买 nike

在 fabric.js 中旋转组时,组的 .left 和 .top 值会“跳跃”。这是一个 fabric.js 错误还是可以解释/预期的?

group.on "moving", ->
#Yields values of about 100 px, also after the group was rotated

group.on "rotating", ->
#Yields values of about 130 px

JSFiddle -> http://jsfiddle.net/thomasf1/X76X9/2/

最佳答案

差异是由于 originX 和 originY 值在旋转时发生变化。 originX 和 originY 将变为“center”,代替它们的典型值“left”和“top”。我遇到了定位会发生变化的类似问题,我发现我需要了解原点值。

关于javascript - Fabric .js : Positioning bug when rotating a group?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24306512/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com