We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
相关截图
描述问题bug 比如上面focus=[0,0]和focus=[0.5,0.5],当pivot不是(0.5,0.5)的时候,focus就不是预期想要的左上角focus=[0,0]点和图形中心点focus=[0.5,0.5]了
预期效果 下面是把Anchor修改成固定返回(0.5,0.5),感觉这样的结果才是正确的,望解答下疑问
相关代码 例如get_position里使用focus参数时,anchorPoint属性值会参与计算,当anchor不是0.5,0.5时,结果不符合预期
def get_position(self, focus=None): focus = focus or self._focus or 'anchor' if focus == 'anchor': pos = self.attr('pos') elif focus == 'center': x, y = self.attr('pos') w, h = self.get_size() ap_x, ap_y = self.attr("anchorPoint") fx, fy = 0.5, 0.5 pos = [x + w * (fx - ap_x), y + h * (fy - ap_y)] elif type(focus) in (list, tuple): x, y = self.attr('pos') w, h = self.get_size() ap_x, ap_y = self.attr("anchorPoint") fx, fy = focus pos = [x + w * (fx - ap_x), y + h * (fy - ap_y)] else: raise TypeError('Unsupported focus type {}. ' 'Only "anchor/center" or 2-list/2-tuple available.'.format(type(focus))) return pos
The text was updated successfully, but these errors were encountered:
No branches or pull requests
相关截图
描述问题bug
比如上面focus=[0,0]和focus=[0.5,0.5],当pivot不是(0.5,0.5)的时候,focus就不是预期想要的左上角focus=[0,0]点和图形中心点focus=[0.5,0.5]了
预期效果
下面是把Anchor修改成固定返回(0.5,0.5),感觉这样的结果才是正确的,望解答下疑问
相关代码
例如get_position里使用focus参数时,anchorPoint属性值会参与计算,当anchor不是0.5,0.5时,结果不符合预期
The text was updated successfully, but these errors were encountered: