Posted: Sat Dec 10, 2005 12:38 am
I think the relevant code parts in "lm_line_width.lua" are the following:
By dragging the mouse to the left the value of offset can become negative. This offset is then added to the width of the selected point or points.
In another part of the code there is a check for a negative value of the width of the selected point or points. If it is negative, it is assigned a zero value.
I assume Moho's rendering engine uses the negative value to indicate that no outline is selected. But would it be possible to change this into -64 and make it possible that line widths between -64 (not inclusive) and 0 are not rendered, but still be considered outlines?
It would certainly solve this little artistic problem.
Added: Err, of course, if anyone drags the offset beyond -64, the same problem occurs as when you drag too far to the right with your mouse and make all points 64 pixels wide. So the method is not foolproof, but it would be an improvement.
Code: Select all
local offset = moho:PixelToDoc((mouseEvent.pt.x - mouseEvent.startPt.x) / 16)
local maxWidth = moho:PixelToDoc(64)
if (self.numSel == 1) then
local pt = mesh:Point(self.selID)
pt.fWidth.value = pt.fTempWidth + offset
pt.fWidth.value = LM.Clamp(pt.fWidth.value, 0, maxWidth)
pt.fWidth:StoreValue()
else
for i, pt in self.selList do
pt.fWidth.value = pt.fTempWidth + offset
pt.fWidth.value = LM.Clamp(pt.fWidth.value, 0, maxWidth)
pt.fWidth:StoreValue()
end
end
Code: Select all
if (pt.fWidth.value < 0) then
pt.fWidth:SetValue(moho.frame, 0)
end
I assume Moho's rendering engine uses the negative value to indicate that no outline is selected. But would it be possible to change this into -64 and make it possible that line widths between -64 (not inclusive) and 0 are not rendered, but still be considered outlines?
It would certainly solve this little artistic problem.
Added: Err, of course, if anyone drags the offset beyond -64, the same problem occurs as when you drag too far to the right with your mouse and make all points 64 pixels wide. So the method is not foolproof, but it would be an improvement.