Karl Ramberg uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-kfr.1020.mcz ==================== Summary ==================== Name: Morphic-kfr.1020 Author: kfr Time: 27 October 2015, 10:51:37.134 pm UUID: d667bea0-4b77-4166-92db-ed20188194c0 Ancestors: Morphic-kfr.1019 Fixing =============== Diff against Morphic-kfr.1019 =============== Item was changed: ----- Method: GradientEditor>>addHandle (in category 'change reporting') ----- addHandle + self addHandleForColor: Color random position: 0.5. - | handleInstance colorIcon | - handleInstance := self handle. - colorIcon := SketchMorph - withForm: ((Color random value iconOrThumbnailOfSize: 20) borderWidth: 1 color: Color black).. - self eventHandler: colorIcon target: colorIcon. - self eventHandler: handleInstance target: self. - row addMorph: handleInstance. - handleInstance position: gradientDisplay left - 10 + (gradientDisplay width // 2) @ (gradientDisplay top - 18). - handleInstance addMorph: colorIcon. - rampMorphs addLast: handleInstance. - colorIcon position: gradientDisplay left - 10 + (gradientDisplay width // 2) @ (gradientDisplay bottom + 5). self updateColorRamp! Item was added: + ----- Method: GradientEditor>>addHandleForColor:position: (in category 'change reporting') ----- + addHandleForColor: aColor position: aPosition + | handleInstance colorIcon delta | + handleInstance := self handle. + colorIcon := SketchMorph + withForm: ((aColor iconOrThumbnailOfSize: 20) borderWidth: 1 color: Color black).. + self eventHandler: colorIcon target: colorIcon. + self eventHandler: handleInstance target: self. + row addMorph: handleInstance. + delta := gradientDisplay left - 10 + (gradientDisplay width * aPosition). + handleInstance position: delta @ (gradientDisplay top - 18). + colorIcon position: delta @ (gradientDisplay bottom + 5). + handleInstance addMorph: colorIcon. + rampMorphs addLast: handleInstance. + + ! Item was changed: + ----- Method: GradientEditor>>addHandles (in category 'change reporting') ----- - ----- Method: GradientEditor>>addHandles (in category 'initialization') ----- addHandles + | handle colorRamp | - | handle handleInstance colorIcon colorRamp | rampMorphs := OrderedCollection new. colorRamp := self gradientDisplay colorRamp asOrderedCollection. handle := self handle. colorRamp do: [:i | + self addHandleForColor: i value position: i key + ]. + - colorIcon := SketchMorph - withForm: ((i value iconOrThumbnailOfSize: 20) borderWidth: 1 color: Color black).. - self eventHandler: colorIcon target: colorIcon. - handleInstance := handle copy. - self eventHandler: handleInstance target: self. - row addMorph: handleInstance. - handleInstance position: gradientDisplay left - 10 + (gradientDisplay width * i key) @ (gradientDisplay top - 18). - handleInstance addMorph: colorIcon. - rampMorphs addLast: handleInstance. - colorIcon position: gradientDisplay left - 10 + (gradientDisplay width * i key) @ (gradientDisplay bottom + 5)]. self changed.! |
Free forum by Nabble | Edit this page |