2015-04-26 1:35 GMT+02:00 Aliaksei Syrel <alex.syrel@gmail.com>:
Can we remove #brickValue: ?
I don't see how this is different from #cull:
And the name is strange, I don't see how this depends an a brick.

Not really, it is implemented also in Object.

Ah, ok, I missed that one.
��
It is used to script brick layout properties. So user can say:

brick height: 10.
brick height: #approximate.
brick height: [ :b | b width * 2].

or even

brick height: HeightStrategy new.

so brickValue: is sent to any kind of object that is used as height. So without changing brick itself user can implement its own class and override brickValue: and have custom strategy to calculate height.

Such practice is used in many places in brick.


I saw the call to brickValue: in GTSpotter and GLMAnimation, is it only used for brick attributes, like in your example above?

nicolai

��


Cheers,
Alex

On Sun, Apr 26, 2015 at 12:16 AM, Nicolai Hess <nicolaihess@web.de> wrote:
Can we remove #brickValue: ?
I don't see how this is different from #cull:
And the name is strange, I don't see how this depends an a brick.

nicolai