Paint bucket issue

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: heatherlaine, Klaus, FourthWorld, robinmiller, kevinmiller

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2174
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Paint bucket issue

Post by jmburnod » Sat Dec 30, 2017 9:55 pm

Hi All,
When i use paint bucket to change color of an uniform area, some points, area or line don't take the selected color.
I tested it with versions 7.0.6, 8.1.6 and 8.1.8 with the same result.
To reproduce it:
1. choose large brush and a color (blue)
2. draw a large area
3. Choose bucket tool
4. choose an other color (red)
5. click on the blue area
Unfortunately, that make paint bucket unusable while that is a precious tool for paint app for kids.
Do you consider this as a bug ?
Best regards
Jean-Marc

quailcreek
Posts: 691
Joined: Sun Feb 04, 2007 11:01 pm
Location: McKenna, WA

Re: Paint bucket issue

Post by quailcreek » Sun Dec 31, 2017 12:35 am

I tried this in LC 8.1.8 and 8.1.9 rc1 and it works fine. I did notice that the brush tool shape pallet gets placed to the left of the tools pallet. So if your tool pallet is close the the left of the screen the tool shape pallet could be placed off screen. That is the only bug I see.
Tom
MacBook Pro OS High Sierra 10.13.3

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 2437
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria
Contact:

Re: Paint bucket issue

Post by richmond62 » Sun Dec 31, 2017 10:06 am

Oddly enough, after 16 years of working with RR/LiveCode I have never used the Paint Tools:
I've always viewed them as needless leftovers from the HyperCard heritage. 8)

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2174
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: Paint bucket issue

Post by jmburnod » Sun Dec 31, 2017 11:24 am

Thanks for your quick reply.
I dont understand why it works for you.
Here is a stack with two examples bad results.
Attachments
stBucketIssue.zip
(6.26 KiB) Downloaded 14 times

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 2437
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria
Contact:

Re: Paint bucket issue

Post by richmond62 » Sun Dec 31, 2017 11:31 am

Screen Shot 2017-12-31 at 12.28.28 pm.png
Screen Shot 2017-12-31 at 12.28.28 pm.png (15.26 KiB) Viewed 741 times
I suspect that the paint tools in LiveCode detect subtle differences in the colour of your initial
shapes . . .

IF a shape contains a 100% uniform colour the paint tools should fill it entirely:
I think your shapes look 100% uniform to the human eye, but not to the computer.

My own experience with brush tools (admittedly not in LiveCoode)
is that they draw a non-uniform coloured line that is no good at all
if you are looking for something to later recolour with a paint-bucket tool.

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2174
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: Paint bucket issue

Post by jmburnod » Sun Dec 31, 2017 1:08 pm

Hi Richmond
Thanks for the image (I was lazy this morning)
I suspect that the paint tools in LiveCode detect subtle differences in the colour of your initial
shapes . . .
Yes,
I think your shapes look 100% uniform to the human eye, but not to the computer.
Yes, but how can i produce it with standard brush and color from tools palette?

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2174
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: Paint bucket issue

Post by jmburnod » Sun Dec 31, 2017 3:43 pm

I tried using an image id as brush.
Same result I described in prev posts :(

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 2437
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria
Contact:

Re: Paint bucket issue

Post by richmond62 » Sun Dec 31, 2017 6:19 pm

how can i produce it with standard brush and color from tools palette?
I don't think you can . . .

The paint tools are set up as . . . paint tools 8)

and paint tools are meant to work like a physical paintbrush and so forth:
if this is unclear go and get a paint brush, slop it in some paint and TRY
to paint a line with a hard margin and evenly distributed colour: you won't
manage that: AND we should be very, very grateful indeed,
because we would not have fantastic paintings if that were so.
Yo.jpg
Yo.jpg (69.39 KiB) Viewed 690 times
Vector things such as graphic objects in LiveCode can be filled with
uniform colour for the simple reason that they are 'just' walls to contain paint,
and Tintoretto (who painted that picture) would have had a bad attack of
the dry boak.

If you take a close look at the revTools palette you will notice that the painting
"thingies" are divided into 2 groups:
paintTools.png
paintTools.png (15.3 KiB) Viewed 690 times
Those ABOVE the red line are for VECTOR graphics, and those
BELOW
the red line are for PAINT (rasterised) graphics, and they
are like OIL and WATER: they just don't mix.

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2174
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: Paint bucket issue

Post by jmburnod » Sun Dec 31, 2017 6:30 pm

I don't think you can . . .
Yes, I can.
I create the two images i posted in the stack with standard brush and colors.
There are paint image, no vector image

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 2437
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria
Contact:

Re: Paint bucket issue

Post by richmond62 » Sun Dec 31, 2017 6:33 pm

Yes, I can.
I create the two images i posted in the stack with standard brush and colors.
There are paint image, no vector image
Indeed you did.

What you CANNOT do, however, is rely on what you create to be a single,
solid colour so you can subsequently fill it with a different colour using
the bucket tool.

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2174
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: Paint bucket issue

Post by jmburnod » Sun Dec 31, 2017 7:42 pm

What you CANNOT do, however, is rely on what you create to be a single,
solid colour
I don't create anything, I just use livecode tools to create an single and solid color, but it doesn't work.
I attached a demo stack to watch what happens
stBucketIssueDemo.livecode.zip
(2.91 KiB) Downloaded 18 times

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 2437
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria
Contact:

Re: Paint bucket issue

Post by richmond62 » Sun Dec 31, 2017 8:11 pm

I don't create anything
Well, the computer doesn't do it by itself.

I downloaded your DEMO and got this:
Screen Shot 2017-12-31 at 9.03.09 pm.png
Screen Shot 2017-12-31 at 9.03.09 pm.png (3.79 KiB) Viewed 670 times
Which, is, obviously, a load of rubbish.

So, I modified your script to produce this:
Screen Shot 2017-12-31 at 9.06.27 pm.png
Screen Shot 2017-12-31 at 9.06.27 pm.png (3.7 KiB) Viewed 670 times
and exported is as a PNG image, and then opened it in GIMP.

This FILLED evenly with a single colour:
filled.png
filled.png (461 Bytes) Viewed 670 times
Which DOES suggest there is something wrong with LiveCode's bucket tool

(apologies for earlier comments).

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1682
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

Re: Paint bucket issue

Post by [-hh] » Sun Dec 31, 2017 8:20 pm

Hi J-M,

the bucket tool is designed for filling closed shapes, especially closed shapes drawn with the line tool. It should not fill the bordering lines.

Trying to fill the border lines itself would need another flood fill algorithm that is not available in the paint tools.

For example if you draw (freehand) an closed oval shape of radius 20 with a linesize of 10 then this will be filled perfectly by clicking _inside_, not on a pixel of the bordering line. But trying to fill _the line itself_ shows the "bug" that you describe.

@ALL: Have a nice end of 2017!

H.
shiftLock happens

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 2437
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria
Contact:

Re: Paint bucket issue

Post by richmond62 » Mon Jan 01, 2018 10:24 am

MetaCard.png
Oddly enough THIS does work using the MetaCard Paint Tools 8)

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2174
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: Paint bucket issue

Post by jmburnod » Mon Jan 01, 2018 11:20 am

I was almost sure I used bucket with succes for what i described
I tested it with LC 4.6.3, bucket works.
I can fill a close area and change the color of a single and solid area perfectly

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”