[squeak-dev] The Inbox: Morphic-kfr.2018.mcz
commits at source.squeak.org
commits at source.squeak.org
Fri Jul 8 08:48:42 UTC 2022
A new version of Morphic was added to project The Inbox:
http://source.squeak.org/inbox/Morphic-kfr.2018.mcz
==================== Summary ====================
Name: Morphic-kfr.2018
Author: kfr
Time: 8 July 2022, 10:48:29.812763 am
UUID: 6692194d-4fbe-a64e-ba77-0aae73052fb9
Ancestors: Morphic-mt.2017
Add menu items for dither. Depends on Graphics-kfr.529.
Small fix for reduceColorPalette. Return a copy instead of destroying original
=============== Diff against Morphic-mt.2017 ===============
Item was changed:
----- Method: Morph>>addPaintingItemsTo:hand: (in category 'menus') -----
addPaintingItemsTo: aMenu hand: aHandMorph
| subMenu movies |
subMenu := MenuMorph new defaultTarget: self.
subMenu
add: 'repaint' translated action: #editDrawing;
add: 'set rotation center' translated action: #setRotationCenter;
add: 'reset forward-direction' translated action: #resetForwardDirection;
add: 'set rotation style' translated action: #setRotationStyle;
add: 'erase pixels of color' translated action: #erasePixelsUsing:;
add: 'recolor pixels of color' translated action: #recolorPixelsUsing:;
add: 'reduce color palette' translated action: #reduceColorPalette:;
add: 'detect edges' translated action: #edgeDetect;
add: 'sharpen' translated action: #sharpen;
add: 'blur' translated action: #blur;
add: 'emboss' translated action: #emboss;
+ add: 'dither' translated action: #dither;
add: 'add a border around this shape...' translated action: #addBorderToShape:.
movies := (self world rootMorphsAt: aHandMorph targetPoint)
select: [:m | (m isKindOf: MovieMorph) or: [m isSketchMorph]].
movies size > 1
ifTrue:
[subMenu add: 'insert into movie' translated action: #insertIntoMovie:].
aMenu add: 'painting...' translated subMenu: subMenu!
Item was added:
+ ----- Method: SketchMorph>>dither (in category 'menu') -----
+ dither
+ | menu result |
+ menu := SelectionMenu labels: #('1' '2' '4' '8') selections: #(1 2 4 8).
+ result := menu startUpWithCaption: 'Choose a depth' translated.
+ Cursor wait showWhile:[^(SketchMorph withForm: (self form dither: result)) openInHand]
+ !
Item was changed:
----- Method: SketchMorph>>reduceColorPalette: (in category 'menu') -----
reduceColorPalette: evt
"Let the user ask for a reduced number of colors in this sketch"
| str nColors |
str := UIManager default
+ request: 'Please enter a number greater than one.' translated
- request: 'Please enter a number greater than one.
- (note: this cannot be undone, so answer zero
- to abort if you need to make a backup first)' translated
initialAnswer: '256'.
nColors := Integer readFrom: (ReadStream on: str).
(nColors between: 2 and: 256) ifFalse: [^ self].
+ (SketchMorph withForm: (originalForm copyWithColorsReducedTo: nColors)) openInHand
+ !
-
- originalForm := originalForm copyWithColorsReducedTo: nColors.
- rotatedForm := nil.
- self changed!
More information about the Squeak-dev
mailing list
|