本文介绍了Fabric.js FlipX和FlipY似乎不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

即使使用直接来自此处教程的代码- http://fabricjs.com/fabric-intro-part-1/#objects .如果有人可以看一下这个小提琴,让我知道我在做错什么,我将不胜感激.

I can't flip a rectangle to save my life in Fabric.js, even using the code straight from the tutorials here - http://fabricjs.com/fabric-intro-part-1/#objects. If someone could please take a look at this fiddle and let me know what I'm doing wrong, I'd greatly appreciate it.

http://jsfiddle.net/thardy/E4Vcr/

rect.set('angle', 15).set('flipY', true); // doesn't work
canvas.renderAll(); // this wasn't in the tutorial, but I'm pretty sure it's needed

这是v1.4.0中的错误吗?

Is this a bug in v1.4.0?

推荐答案

这似乎是对flipX和flipY应该如何工作的误解.我认为他们实际上是在fabricjs中工作.我已经更新了上面的小提琴,以更清楚地显示为什么我认为他们没有工作.也许这对将来的某人会有帮助

This appears to be a misunderstanding of how flipX and flipY are supposed to work. I think they are actually working in fabricjs. I've updated my fiddle above to more clearly display why I didn't think they were working. Perhaps this will be helpful to someone in the future

这篇关于Fabric.js FlipX和FlipY似乎不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-14 16:21