Skip to content
New issue

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

窗口改变后canvas尺寸无法自适应 #405

Open
zqd77 opened this issue Jun 17, 2022 · 4 comments
Open

窗口改变后canvas尺寸无法自适应 #405

zqd77 opened this issue Jun 17, 2022 · 4 comments
Labels

Comments

@zqd77
Copy link

zqd77 commented Jun 17, 2022

调用哪个方法可以在窗口大小改变后尺寸可以更新呢?还有demo有问题了,网址打不开了,现在的版本也不支持vue2.0了吗。。。

@hujiulong hujiulong added the bug label Jun 17, 2022
@hujiulong
Copy link
Owner

网站国内访问有点慢,需要科学上网

@zqd77
Copy link
Author

zqd77 commented Jun 18, 2022

科学上网了,demo还是打不开,麻烦指导下窗口大小尺寸改变后3D-model调用什么方法可以自适应,感谢感谢

@hujiulong
Copy link
Owner

科学上网了,demo还是打不开,麻烦指导下窗口大小尺寸改变后3D-model调用什么方法可以自适应,感谢感谢

这是一个 bug ,我会在近期修复

@qingyun1029
Copy link

可以尝试以下这种方式

        changeWidth: throttle(({vm, width}) => {
            vm.$nextTick(() => {
                vm.$refs.modelRef.size = {
                    width: width,
                    height: vm.h,
                };
                vm.$refs.modelRef.updateRenderer()
            })
        }, 100),
        changeHeight: throttle(({vm, height}) => {
            vm.$nextTick(() => {
                vm.$refs.modelRef.size = {
                    width: vm.w,
                    height: height,
                };
                vm.$refs.modelRef.updateRenderer()
            })
        }, 100),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants