diff --git a/src/Bloc-MemoryGame-Demo.package/MgdGameModel.class/instance/initializeForSymbols..st b/src/Bloc-MemoryGame-Demo.package/MgdGameModel.class/instance/initializeForSymbols..st index b22ce0b..9102ded 100644 --- a/src/Bloc-MemoryGame-Demo.package/MgdGameModel.class/instance/initializeForSymbols..st +++ b/src/Bloc-MemoryGame-Demo.package/MgdGameModel.class/instance/initializeForSymbols..st @@ -13,4 +13,4 @@ initializeForSymbols: aCollectionOfCharacters availableCards := (aCollectionOfCharacters asArray collect: [ :aSymbol | (1 to: self matchesCount) collect: [ :i | - MgCardModel new symbol: aSymbol ] ] ) flattened shuffled asOrderedCollection \ No newline at end of file + MgdCardModel new symbol: aSymbol ] ] ) flattened shuffled asOrderedCollection \ No newline at end of file diff --git a/src/Bloc-MemoryGame.package/MgRawCardElement.class/instance/drawBacksideOn..st b/src/Bloc-MemoryGame.package/MgRawCardElement.class/instance/drawBacksideOn..st new file mode 100644 index 0000000..a39a9ce --- /dev/null +++ b/src/Bloc-MemoryGame.package/MgRawCardElement.class/instance/drawBacksideOn..st @@ -0,0 +1,12 @@ +drawing +drawBacksideOn: aCanvas + + aCanvas stroke + paint: Color paleBlue; + path: (aCanvas shape line: 0@0 to: self extent); + draw. + + aCanvas stroke + paint: Color paleBlue; + path: (aCanvas shape line: self width @ 0 to: 0@self height); + draw \ No newline at end of file diff --git a/src/Bloc-MemoryGame.package/MgRawCardElement.class/instance/drawBacksideOnSpartaCanvas..st b/src/Bloc-MemoryGame.package/MgRawCardElement.class/instance/drawBacksideOnSpartaCanvas..st deleted file mode 100644 index c5fafd0..0000000 --- a/src/Bloc-MemoryGame.package/MgRawCardElement.class/instance/drawBacksideOnSpartaCanvas..st +++ /dev/null @@ -1,16 +0,0 @@ -drawing -drawBacksideOnSpartaCanvas: aCanvas - - aCanvas stroke - paint: Color paleBlue; - path: (aCanvas shape - line: 0@0 - to: self extent); - draw. - - aCanvas stroke - paint: Color paleBlue; - path: (aCanvas shape - line: self width @ 0 - to: 0@self height); - draw \ No newline at end of file diff --git a/src/Bloc-MemoryGame.package/MgRawCardElement.class/instance/drawCommonOn..st b/src/Bloc-MemoryGame.package/MgRawCardElement.class/instance/drawCommonOn..st new file mode 100644 index 0000000..e2107c2 --- /dev/null +++ b/src/Bloc-MemoryGame.package/MgRawCardElement.class/instance/drawCommonOn..st @@ -0,0 +1,6 @@ +drawing +drawCommonOn: aCanvas + aCanvas fill + paint: self backgroundPaint; + path: self boundsInLocal; + draw \ No newline at end of file diff --git a/src/Bloc-MemoryGame.package/MgRawCardElement.class/instance/drawFlippedSideOnSpartaCanvas..st b/src/Bloc-MemoryGame.package/MgRawCardElement.class/instance/drawFlippedSideOn..st similarity index 91% rename from src/Bloc-MemoryGame.package/MgRawCardElement.class/instance/drawFlippedSideOnSpartaCanvas..st rename to src/Bloc-MemoryGame.package/MgRawCardElement.class/instance/drawFlippedSideOn..st index 7682b19..2e93363 100644 --- a/src/Bloc-MemoryGame.package/MgRawCardElement.class/instance/drawFlippedSideOnSpartaCanvas..st +++ b/src/Bloc-MemoryGame.package/MgRawCardElement.class/instance/drawFlippedSideOn..st @@ -1,5 +1,5 @@ drawing -drawFlippedSideOnSpartaCanvas: aCanvas +drawFlippedSideOn: aCanvas | font textPainter metrics baseline origin | font := aCanvas font diff --git a/src/Bloc-MemoryGame.package/MgRawCardElement.class/instance/drawOnSpartaCanvas..st b/src/Bloc-MemoryGame.package/MgRawCardElement.class/instance/drawOnSpartaCanvas..st index c0a7d13..86c4a15 100644 --- a/src/Bloc-MemoryGame.package/MgRawCardElement.class/instance/drawOnSpartaCanvas..st +++ b/src/Bloc-MemoryGame.package/MgRawCardElement.class/instance/drawOnSpartaCanvas..st @@ -3,17 +3,13 @@ drawOnSpartaCanvas: aCanvas | roundedRectangle | roundedRectangle := aCanvas shape - roundedRectangle: self boundsInLocal - radii: (BlCornerRadii radius: self cornerRadius). - + roundedRectangle: self boundsInLocal + radii: (BlCornerRadii radius: self cornerRadius). + aCanvas clip by: roundedRectangle during: [ - aCanvas fill - paint: self backgroundPaint; - path: self boundsInLocal; - draw. - + self drawCommonOn: aCanvas. self card isFlipped - ifTrue: [ self drawFlippedSideOnSpartaCanvas: aCanvas ] - ifFalse: [ self drawBacksideOnSpartaCanvas: aCanvas ] ] \ No newline at end of file + ifTrue: [ self drawFlippedSideOn: aCanvas ] + ifFalse: [ self drawBacksideOn: aCanvas ] ] \ No newline at end of file