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 ////////////////////////////////////////////////////////
modules.gui = '2017-September-08';
modules.gui = '2017-September-14';
// Declarations
@ -1484,12 +1484,12 @@ IDE_Morph.prototype.createCorralBar = function () {
);
this.corralBar.add(paintbutton);
if (CamSnapshotDialogMorph.prototype.enableCamera) {
cambutton = new PushButtonMorph(
this,
"newCamSprite",
new SymbolMorph("camera", 15)
);
cambutton.corner = 12;
cambutton.color = colors[0];
cambutton.highlightColor = colors[1];
@ -1512,7 +1512,6 @@ IDE_Morph.prototype.createCorralBar = function () {
paintbutton.width() +
padding
);
if (location.protocol === 'http:') {
cambutton.hint = 'Due to browser security policies, you need to\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.';
cambutton.disable();
}
this.corralBar.add(cambutton);
}
};
@ -1920,6 +1919,14 @@ IDE_Morph.prototype.toggleSingleStepping = function () {
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 () {
this.stage.isFastTracked = true;
this.stage.fps = 0;
@ -2570,6 +2577,14 @@ IDE_Morph.prototype.settingsMenu = function () {
'check to turn on\n visible stepping (slow)',
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
addPreference(
'Blurred shadows',
@ -7293,8 +7308,9 @@ CostumeIconMorph.prototype.duplicateCostume = function () {
CostumeIconMorph.prototype.removeCostume = function () {
var wardrobe = this.parentThatIsA(WardrobeMorph),
idx = this.parent.children.indexOf(this),
off = CamSnapshotDialogMorph.prototype.enableCamera ? 3 : 2,
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) {
ide.currentSprite.wearCostume(null);
}
@ -7612,6 +7628,7 @@ WardrobeMorph.prototype.updateList = function () {
this.addContents(paintbutton);
if (CamSnapshotDialogMorph.prototype.enableCamera) {
cambutton = new PushButtonMorph(
this,
"newFromCam",
@ -7633,7 +7650,6 @@ WardrobeMorph.prototype.updateList = function () {
cambutton.fixLayout();
cambutton.setCenter(paintbutton.center());
cambutton.setLeft(paintbutton.right() + toolsPadding);
if (location.protocol === 'http:') {
cambutton.hint = 'Due to browser security policies, you need to\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.';
cambutton.disable();
}
this.addContents(cambutton);
}
txt = new TextMorph(localize(
"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
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.prototype.enableCamera = false; // has issues with retina
CamSnapshotDialogMorph.prototype = new DialogBoxMorph();
CamSnapshotDialogMorph.prototype.constructor = CamSnapshotDialogMorph;
CamSnapshotDialogMorph.uber = DialogBoxMorph.prototype;

Wyświetl plik

@ -3619,6 +3619,10 @@ Fixes:
------
* 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:
* polymorphic sprite-local custom blocks