disable camera because of retina issues

(but make it accessible as hidden setting while we’re working on it)
upd4.1
Jens Mönig 2017-09-14 15:34:44 +02:00
rodzic ba9a7bd6f6
commit 5516f93da5
2 zmienionych plików z 92 dodań i 70 usunięć

34
gui.js
Wyświetl plik

@ -75,7 +75,7 @@ isRetinaSupported, SliderMorph, Animation*/
// Global stuff //////////////////////////////////////////////////////// // Global stuff ////////////////////////////////////////////////////////
modules.gui = '2017-September-08'; modules.gui = '2017-September-14';
// Declarations // Declarations
@ -1484,12 +1484,12 @@ IDE_Morph.prototype.createCorralBar = function () {
); );
this.corralBar.add(paintbutton); this.corralBar.add(paintbutton);
if (CamSnapshotDialogMorph.prototype.enableCamera) {
cambutton = new PushButtonMorph( cambutton = new PushButtonMorph(
this, this,
"newCamSprite", "newCamSprite",
new SymbolMorph("camera", 15) new SymbolMorph("camera", 15)
); );
cambutton.corner = 12; cambutton.corner = 12;
cambutton.color = colors[0]; cambutton.color = colors[0];
cambutton.highlightColor = colors[1]; cambutton.highlightColor = colors[1];
@ -1512,7 +1512,6 @@ IDE_Morph.prototype.createCorralBar = function () {
paintbutton.width() + paintbutton.width() +
padding padding
); );
if (location.protocol === 'http:') { if (location.protocol === 'http:') {
cambutton.hint = 'Due to browser security policies, you need to\n' + cambutton.hint = 'Due to browser security policies, you need to\n' +
'access Snap! through HTTPS to use the camera.\n\n' + 'access Snap! through HTTPS to use the camera.\n\n' +
@ -1520,8 +1519,8 @@ IDE_Morph.prototype.createCorralBar = function () {
'in your browser by "https://" and try again.'; 'in your browser by "https://" and try again.';
cambutton.disable(); cambutton.disable();
} }
this.corralBar.add(cambutton); this.corralBar.add(cambutton);
}
}; };
@ -1920,6 +1919,14 @@ IDE_Morph.prototype.toggleSingleStepping = function () {
this.controlBar.refreshSlider(); this.controlBar.refreshSlider();
}; };
IDE_Morph.prototype.toggleCameraSupport = function () {
CamSnapshotDialogMorph.prototype.enableCamera =
!CamSnapshotDialogMorph.prototype.enableCamera;
this.spriteBar.tabBar.tabTo(this.currentTab);
this.createCorralBar();
this.fixLayout();
};
IDE_Morph.prototype.startFastTracking = function () { IDE_Morph.prototype.startFastTracking = function () {
this.stage.isFastTracked = true; this.stage.isFastTracked = true;
this.stage.fps = 0; this.stage.fps = 0;
@ -2570,6 +2577,14 @@ IDE_Morph.prototype.settingsMenu = function () {
'check to turn on\n visible stepping (slow)', 'check to turn on\n visible stepping (slow)',
false false
); );
addPreference(
'Camera support',
'toggleCameraSupport',
CamSnapshotDialogMorph.prototype.enableCamera,
'uncheck to disable\ncamera support',
'check to enable\ncamera support',
true
);
menu.addLine(); // everything visible below is persistent menu.addLine(); // everything visible below is persistent
addPreference( addPreference(
'Blurred shadows', 'Blurred shadows',
@ -7293,8 +7308,9 @@ CostumeIconMorph.prototype.duplicateCostume = function () {
CostumeIconMorph.prototype.removeCostume = function () { CostumeIconMorph.prototype.removeCostume = function () {
var wardrobe = this.parentThatIsA(WardrobeMorph), var wardrobe = this.parentThatIsA(WardrobeMorph),
idx = this.parent.children.indexOf(this), idx = this.parent.children.indexOf(this),
off = CamSnapshotDialogMorph.prototype.enableCamera ? 3 : 2,
ide = this.parentThatIsA(IDE_Morph); ide = this.parentThatIsA(IDE_Morph);
wardrobe.removeCostumeAt(idx - 3); // ignore the paintbrush and camera buttons wardrobe.removeCostumeAt(idx - off); // ignore paintbrush and camera buttons
if (ide.currentSprite.costume === this.object) { if (ide.currentSprite.costume === this.object) {
ide.currentSprite.wearCostume(null); ide.currentSprite.wearCostume(null);
} }
@ -7612,6 +7628,7 @@ WardrobeMorph.prototype.updateList = function () {
this.addContents(paintbutton); this.addContents(paintbutton);
if (CamSnapshotDialogMorph.prototype.enableCamera) {
cambutton = new PushButtonMorph( cambutton = new PushButtonMorph(
this, this,
"newFromCam", "newFromCam",
@ -7633,7 +7650,6 @@ WardrobeMorph.prototype.updateList = function () {
cambutton.fixLayout(); cambutton.fixLayout();
cambutton.setCenter(paintbutton.center()); cambutton.setCenter(paintbutton.center());
cambutton.setLeft(paintbutton.right() + toolsPadding); cambutton.setLeft(paintbutton.right() + toolsPadding);
if (location.protocol === 'http:') { if (location.protocol === 'http:') {
cambutton.hint = 'Due to browser security policies, you need to\n' + cambutton.hint = 'Due to browser security policies, you need to\n' +
'access Snap! through HTTPS to use the camera.\n\n' + 'access Snap! through HTTPS to use the camera.\n\n' +
@ -7641,8 +7657,8 @@ WardrobeMorph.prototype.updateList = function () {
'in your browser by "https://" and try again.'; 'in your browser by "https://" and try again.';
cambutton.disable(); cambutton.disable();
} }
this.addContents(cambutton); this.addContents(cambutton);
}
txt = new TextMorph(localize( txt = new TextMorph(localize(
"costumes tab help" // look up long string in translator "costumes tab help" // look up long string in translator
@ -8341,11 +8357,13 @@ PaletteHandleMorph.prototype.mouseDoubleClick = function () {
/* /*
I am a dialog morph that lets users take a snapshot using their webcam I am a dialog morph that lets users take a snapshot using their webcam
and use it as a costume for their sprites or a background for the Stage. and use it as a costume for their sprites or a background for the Stage.
NOTE: Currently disabled because of issues with retina displays.
*/ */
// CamSnapshotDialogMorph inherits from DialogBoxMorph: // CamSnapshotDialogMorph inherits from DialogBoxMorph:
CamSnapshotDialogMorph.prototype.enableCamera = false; // has issues with retina
CamSnapshotDialogMorph.prototype = new DialogBoxMorph(); CamSnapshotDialogMorph.prototype = new DialogBoxMorph();
CamSnapshotDialogMorph.prototype.constructor = CamSnapshotDialogMorph; CamSnapshotDialogMorph.prototype.constructor = CamSnapshotDialogMorph;
CamSnapshotDialogMorph.uber = DialogBoxMorph.prototype; CamSnapshotDialogMorph.uber = DialogBoxMorph.prototype;

Wyświetl plik

@ -3619,6 +3619,10 @@ Fixes:
------ ------
* GUI, Objects, Widgets, Symbols: Camera Snapshot Dialog. Thank you, Bernat!! * GUI, Objects, Widgets, Symbols: Camera Snapshot Dialog. Thank you, Bernat!!
170914
------
* GUI: disable camera (but make it accessible as hidden setting) because of retina issues
v4.1 Features: v4.1 Features:
* polymorphic sprite-local custom blocks * polymorphic sprite-local custom blocks