gobstones-blockly 0.15.0 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/assets/htmls/gs-element-blockly.html +6 -3
- data/lib/gobstones/blockly/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5744548cd9ce6c76d9b75de1f19f31c1144df20e86517851eba5798cbc6f7751
|
4
|
+
data.tar.gz: 96f57a6d3a19bd9fa5a752932aef12ae19a6c00fafd96091e432a0e6ee06ee74
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 734484e96e1ebd97f500ea29ee02653e1dc860fc016ba697386d8afe2153ed2ccf8a92ec7e689f8c9a58b3623c2eb2f4ba616dd580e8c9bcb21b22f539d77ac9
|
7
|
+
data.tar.gz: b0ad0b0fad35cca3cb6056a137cc61b94db213505ddef4793fd9223abba7e88519a90269548e279461ca10f89905664598122b4a63f93480f8f2ba0a7e1e9c92
|
@@ -6584,7 +6584,7 @@ Blockly.ErrorInforming.CssContent = [
|
|
6584
6584
|
this.workspace.showBlockError(blockId, errorKind);
|
6585
6585
|
},
|
6586
6586
|
|
6587
|
-
scrollToBlock: function(blockId) {
|
6587
|
+
scrollToBlock: function(blockId, centered = false) {
|
6588
6588
|
const block = blockId
|
6589
6589
|
? this.workspace.getBlockById(blockId)
|
6590
6590
|
: this.workspace.getAllBlocks().find((it) => it.type === "Program");
|
@@ -6593,9 +6593,12 @@ Blockly.ErrorInforming.CssContent = [
|
|
6593
6593
|
const position = block.getRelativeToSurfaceXY();
|
6594
6594
|
const { viewLeft, contentLeft, viewTop, contentTop, viewWidth, viewHeight } = this.workspace.getMetrics();
|
6595
6595
|
|
6596
|
+
const offsetX = centered ? viewWidth / 4 : 25;
|
6597
|
+
const offsetY = centered ? viewHeight / 2 : 25;
|
6598
|
+
|
6596
6599
|
const finalPosition = {
|
6597
|
-
x: position.x -
|
6598
|
-
y: position.y -
|
6600
|
+
x: position.x - offsetX - contentLeft,
|
6601
|
+
y: position.y - offsetY - contentTop
|
6599
6602
|
};
|
6600
6603
|
|
6601
6604
|
this.workspace.scrollbar.set(finalPosition.x, finalPosition.y);
|