所以我在搞JSFL,我想将storke设置为None。应该这样做:
var stroke = fl.getDocumentDOM().getCustomStroke("toolbar");
stroke.style = "noStroke";
fl.getDocumentDOM().setCustomStroke(stroke);
但这不起作用。
用填充工作做相应的事情! (我在填充方面没有任何问题!)
如果我在工具栏中手动将鹳鸟设置为“无”(使用颜色选择器),然后执行此操作:
var stroke = fl.getDocumentDOM().getCustomStroke("toolbar");
stroke.style = "solid";
stroke.color = "#0066ff";
fl.getDocumentDOM().setCustomStroke(stroke);
我得到一个带有 aRGB 值的实心鹳鸟:00 00 00 00(0 Alpha、0 红色、0 绿色、0 蓝色)。 (使用颜色工具栏通常是不可能的)
如果我再次执行该命令,我会得到正确的描边颜色! (如果我有任何正常的纯色,它也有效。如果笔划是渐变或位图,则不会发生任何情况)。
正如我所提到的,设置填充内容完全没有问题。只有笔画。
So I was messing around with JSFL, and I wanted to set the storke to None. That should be done like this:
var stroke = fl.getDocumentDOM().getCustomStroke("toolbar");
stroke.style = "noStroke";
fl.getDocumentDOM().setCustomStroke(stroke);
But that does NOT work.
Doing the corresponding thing with fills work! (I've had NO trouble with fills at all!)
If I manually set the storke to "None" in the toolbar (using the color-picker), and then execute this:
var stroke = fl.getDocumentDOM().getCustomStroke("toolbar");
stroke.style = "solid";
stroke.color = "#0066ff";
fl.getDocumentDOM().setCustomStroke(stroke);
I get a solid storke with aRGB value: 00 00 00 00 (0 alpha, 0 red, 0 green, 0 blue). (Which normally is impossible using the color-toolbar)
If I execute that command once more, I get the right stroke color! (It also works if I have any normal solid color. If the stroke is a gradient or bitmap, nothing happens).
As I mentioned, there have been NO problems at all with setting things for fills. ONLY strokes.
发布评论
评论(3)
我也遇到过这个错误,它不允许您设置“noStroke”。不过,我已经找到了解决方法。交换描边和填充,然后将填充设置为“noFill”并交换回来。就像这样:
I've also encountered this bug that doesn't allow you to set "noStroke." I have found a workaround, though. Swap the stroke and fill, then set the fill to "noFill" and swap back. Like so:
实际上,您可以将该值设置为“null”,它将把颜色设置为无颜色。
Actually you can set the value to "null" and it will set the color to no color.
似乎 setCustomStroke(myStroke) 仅当
myStroke.style="solid"
并且没有其他属性时才将描边设置为 none。您不必使用getCustomStroke
获取myStroke
。它可以是只有一个属性style
设置为solid
的通用对象。It seems that setCustomStroke(mystroke) sets stroke to none only when
mystroke.style="solid"
and there are no other properties. You don't have to getmystroke
usinggetCustomStroke
. It can be generic object with only one attributestyle
set tosolid
.