summaryrefslogtreecommitdiff
path: root/byob.js
diff options
context:
space:
mode:
authorjmoenig <jens@moenig.org>2013-03-18 12:32:24 +0100
committerjmoenig <jens@moenig.org>2013-03-18 12:32:24 +0100
commit78ab4de381c5c0d22475f830beeb993199355c22 (patch)
treeac916c2da9758db8d2fdc8a489d3a2bbe3bd52f6 /byob.js
parent0b510366d230399a38f18a8db92dd396a0dad42e (diff)
downloadsnap-byow-78ab4de381c5c0d22475f830beeb993199355c22.tar.gz
snap-byow-78ab4de381c5c0d22475f830beeb993199355c22.zip
Scalable blocks and scripts
Shift-clicking on the settings menu lets you specify a fraction, by which blocks and scripts are scaled, allowing you to e.g. export poster-sized hi-res script pics, or to present Snap! live on hi-res screens and projectors
Diffstat (limited to 'byob.js')
-rw-r--r--byob.js18
1 files changed, 10 insertions, 8 deletions
diff --git a/byob.js b/byob.js
index e8c8080..29ab1b5 100644
--- a/byob.js
+++ b/byob.js
@@ -105,7 +105,7 @@ CommentMorph, localize, CSlotMorph*/
// Global stuff ////////////////////////////////////////////////////////
-modules.byob = '2013-February-18';
+modules.byob = '2013-March-18';
// Declarations
@@ -2002,7 +2002,7 @@ BlockLabelPlaceHolderMorph.prototype.drawNew = function () {
context.beginPath();
context.arc(
cx,
- cy,
+ cy * 1.2,
Math.min(cx, cy),
radians(0),
radians(360),
@@ -2127,7 +2127,8 @@ InputSlotDialogMorph.prototype.init = function (
environment,
category
) {
- var fh = fontHeight(10) / 1.2; // "raw height"
+ var scale = SyntaxElementMorph.prototype.scale,
+ fh = fontHeight(10) / 1.2 * scale; // "raw height"
// additional properties:
this.fragment = fragment || new BlockLabelFragment();
@@ -2152,7 +2153,7 @@ InputSlotDialogMorph.prototype.init = function (
this.slots = new BoxMorph();
this.slots.color = new Color(55, 55, 55); // same as palette
this.slots.borderColor = this.slots.color.lighter(50);
- this.slots.setExtent(new Point((fh + 10) * 24, (fh + 10) * 10.4));
+ this.slots.setExtent(new Point((fh + 10) * 24, (fh + 10 * scale) * 10.4));
this.add(this.slots);
this.createSlotTypeButtons();
this.fixSlotsLayout();
@@ -2548,10 +2549,11 @@ InputSlotDialogMorph.prototype.addSlotArityButton = function (
InputSlotDialogMorph.prototype.fixSlotsLayout = function () {
var slots = this.slots,
- xPadding = 10,
- ypadding = 14,
- bh = fontHeight(10) / 1.2 + 15, // slot type button height
- ah = fontHeight(10) / 1.2 + 10, // arity button height
+ scale = SyntaxElementMorph.prototype.scale,
+ xPadding = 10 * scale,
+ ypadding = 14 * scale,
+ bh = (fontHeight(10) / 1.2 + 15) * scale, // slot type button height
+ ah = (fontHeight(10) / 1.2 + 10) * scale, // arity button height
size = 12, // number slot type radio buttons
cols = [
slots.left() + xPadding,