[squeak-dev] The Trunk: MorphicExtras-eem.320.mcz
commits at source.squeak.org
commits at source.squeak.org
Wed Jul 6 16:45:28 UTC 2022
Eliot Miranda uploaded a new version of MorphicExtras to project The Trunk:
http://source.squeak.org/trunk/MorphicExtras-eem.320.mcz
==================== Summary ====================
Name: MorphicExtras-eem.320
Author: eem
Time: 6 July 2022, 9:45:25.449703 am
UUID: c0d225df-dd2b-4722-ae89-835d65139e20
Ancestors: MorphicExtras-mt.319
Avoid the WebCamMorph>>drawOn: method immediately turning on a webcam that has been turned off, while at the same time ensuring that the drawOn: method does cause the webcam to turn on when first opened.
Use allSubInstances when checking for other users of a webcam in WebCamMorph>>off so that subclasses can be active.
=============== Diff against MorphicExtras-mt.319 ===============
Item was changed:
----- Method: WebCamMorph>>drawOn: (in category 'drawing') -----
drawOn: aCanvas
camIsOn ifFalse:
+ [| turnOn |
+ turnOn := displayForm isNil.
+ self initializeDisplayForm.
+ turnOn ifTrue: [self on]].
- [self initializeDisplayForm.
- self on].
camIsOn ifTrue:
[(CameraInterface frameExtent: camNum) ~= displayForm extent ifTrue:
[self initializeDisplayForm]].
displayForm ifNil:
[self initializeDisplayForm].
useFrameSize ifTrue: [self extent: frameExtent].
self drawCameraImageOn: aCanvas.
self drawFPSOn: aCanvas.
self drawOverlayTextOn: aCanvas!
Item was changed:
----- Method: WebCamMorph>>off (in category 'accessing') -----
off
self stopStepping.
camIsOn := false.
"Be careful not to close the camera if any other morphs are using the same camera."
+ (self class allSubInstances anySatisfy: [:wcm| wcm cameraNumber = camNum and: [wcm cameraIsOn]]) ifFalse:
- (self class allInstances anySatisfy: [:wcm| wcm cameraNumber = camNum and: [wcm cameraIsOn]]) ifFalse:
[CameraInterface closeCamera: camNum].
self changed
"self allInstances select: [:wcm| wcm cameraNumber = 1 and: [wcm cameraIsOn]]"!
More information about the Squeak-dev
mailing list
|