ScrollBar needs a cleanup

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

ScrollBar needs a cleanup

Igor Stasenko
Class vars:

UpArrow
UpArrow8Bit

UpArrow used in:

initialize
        "ScrollBar initialize"
        UpArrow := Form
                                extent: 6 @ 3
                                fromArray: #(805306368 2013265920 4227858432 )
                                offset: 0 @ 0.
        ""
        self initializeImagesCache

upArrow8Bit

        "convert to 8-bit and convert white to transparent to avoid
gratuitous conversion every time we put one in an ImageMorph"

        ^UpArrow8Bit ifNil: [
                UpArrow8Bit := (ColorForm mappingWhiteToTransparentFrom: UpArrow)
asFormOfDepth: 8
        ]

and

UpArrow8Bit used just here:

upArrow8Bit

        "convert to 8-bit and convert white to transparent to avoid
gratuitous conversion every time we put one in an ImageMorph"

        ^UpArrow8Bit ifNil: [
                UpArrow8Bit := (ColorForm mappingWhiteToTransparentFrom: UpArrow)
asFormOfDepth: 8
        ]

and guess what?

upArrow8Bit

not used anywhere (there is no senders of it).

That is really weird piece of code..
If there is an up arrow, then i expect to see down arrow, left and
right as well.. but only up one...

The cleanup in cs

--
Best regards,
Igor Stasenko AKA sig.

ScrollBar-cleanup.1.cs (1K) Download Attachment