Freehand drawing tool in Moho 5.3.

Discuss Moho bugs (or suspected bugs) with other users. To report bugs to Smith Micro, please visit support.smithmicro.com

Moderators: Víctor Paredes, Belgarath, slowtiger

User avatar
Rasheed
Posts: 2008
Joined: Tue May 17, 2005 8:30 am
Location: The Netherlands

Post by Rasheed »

I think the relevant code parts in "lm_line_width.lua" are the following:

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
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.

Code: Select all

if (pt.fWidth.value < 0) then
	pt.fWidth:SetValue(moho.frame, 0)
end
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.
Last edited by Rasheed on Sat Dec 10, 2005 1:02 am, edited 1 time in total.
User avatar
Rasheed
Posts: 2008
Joined: Tue May 17, 2005 8:30 am
Location: The Netherlands

Post by Rasheed »

In fact, I changed (a copy) of "lm_line_width.lua" and commented out the two code lines containing:

Code: Select all

pt.fWidth:SetValue(moho.frame, 0)
by replacing them with:

Code: Select all

--pt.fWidth:SetValue(moho.frame, 0)
And the problems Toontoonz wrote about didn't occur. I could make the selected curves disappear by dragging the mouse to the left and appear with the same line width variation by dragging the mouse to the right.

However, I'm not to sure if this is okay with Moho. Will I run in any trouble if I keep using the modified "lm_line_width.lua" script?
User avatar
Lost Marble
Site Admin
Posts: 2354
Joined: Tue Aug 03, 2004 6:02 pm
Location: Scotts Valley, California, USA
Contact:

Post by Lost Marble »

I don't think that modified script will actually work. Try animating some line widths. Also, you may also get weird results if the line width value for the shape is something other than 1. I wouldn't recommend using that modification.
User avatar
Rasheed
Posts: 2008
Joined: Tue May 17, 2005 8:30 am
Location: The Netherlands

Post by Rasheed »

Okay, then I put the original script back.
User avatar
Rai López
Posts: 2259
Joined: Sun Aug 08, 2004 1:41 pm
Location: Spain
Contact:

Post by Rai López »

Lost Marble wrote:Not really a bug. Think of a photo: First brighten a photo until parts of it turn completely white. Then darken the photo - you won't get the details back in the white areas - they'll all just be a solid shade of gray.
Jaja... HI! :), but LM remember that if we decide working with vector images is for can AVOID this kind of bitmaps limitations ;)
Post Reply