Quick question :
Would you guys say that I would be best to clone or dup the object for non destructive methods in both Bitmap and Color class' ?
I will stick with clone then. - Just in the event the singleton methods are required by potential users 🙂
Also - does this seem legit or have I missed something (again...)
#===============================================================================class Bitmap#=============================================================================== #----------------------------------------------------------------------------- # Modified clone method to return self. #----------------------------------------------------------------------------- def clone super self endendNone of my non destructive effects happen properly if I dont have this in place but i have the feeling I have overlooked something important again :/
Kind of get the feeling that returning self is undoing the clone...
Edit:
Same with dup..
string = 'hello'
class << string
def clone
super
self
end
end
string.clone.upcase! # => 'HELLO'
string # => 'HELLO'
I hope that makes it clear what the problem is.
Its not cloning it at all... Its changing the original.
Hmm...
At least it looks better than the unreadeable version at the status update.
Oh yea. Most of these methods should be called one time only (for each time you wish to change the bitmap).
Also - the usage rights on the scripts are pretty much non existent. I have only requested that the header remains intact so people can see who has contributed to the script's methods 🙂
Just trying to catch up a little bit on workload and then this will be updated again and released for all to use/disregard 😀