Is there option to get current displayed brush width without LAYERS?

Find quick help here to get you started with Hollywood
Post Reply
Bugala
Posts: 1178
Joined: Sun Feb 14, 2010 7:11 pm

Is there option to get current displayed brush width without LAYERS?

Post by Bugala »

When using LAYERS, I can display a brush as a Layer, then if I keep changing the size of that Layer, I can get the current width and height by using the GetAttribute() command.

Since I am now using Brushes without LAYERS ON, then is there anything similar to use to get the current size of my brush?

Point is that I have this own made my_DisplayBrush function, which also takes care of the size of the Brush automatically, and basically, in programming terms, I don't want to know anything about how this my_DisplayBrush function works, but now I have come to a situation where I would actually need to know in which size the current brush is being displayed.

So do I have to modify my_DisplayBrush function to actually give this information to me, or can I use something like GetAttribute() command to figure it out?
User avatar
emeck
Posts: 169
Joined: Fri Apr 03, 2015 3:17 pm

Re: Is there option to get current displayed brush width without LAYERS?

Post by emeck »

GetAttribute() doesn't work?

Code: Select all

GetAttribute(#BRUSH, your_brush_id, #ATTRWIDTH)
PowerBook 5.2 MorphOS 3.15
PowerBook 5.8 MorphOS 3.15
Amiga 1200 BPPC/BVision AOS4.1 FE
Bugala
Posts: 1178
Joined: Sun Feb 14, 2010 7:11 pm

Re: Is there option to get current displayed brush width without LAYERS?

Post by Bugala »

No, because point is that when I display the brush in my my_DisplayBrush() command, it affects the size. So the brush being displayed can be for example 100x100, but in reality it might be displayed as 50x50, for which reason using GetAttribute() would give me the 100x100, not the 50x50 which it in reality is.
User avatar
emeck
Posts: 169
Joined: Fri Apr 03, 2015 3:17 pm

Re: Is there option to get current displayed brush width without LAYERS?

Post by emeck »

Ok, I see.

So inside your function you use DisplayBrush() to show it scaled? Maybe using a copy with ScaleBrush() instead and displaying that one? That way you can use GetAttribute() with the copy.
PowerBook 5.2 MorphOS 3.15
PowerBook 5.8 MorphOS 3.15
Amiga 1200 BPPC/BVision AOS4.1 FE
Bugala
Posts: 1178
Joined: Sun Feb 14, 2010 7:11 pm

Re: Is there option to get current displayed brush width without LAYERS?

Post by Bugala »

Not the most elegant solution, but could work. For this way I wouldn't need to know the inner works of my_DisplayBrush function, nor need it to return anything. I might use this. Thanks!
Post Reply