gobstones-blockly 0.15.0 → 0.16.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 986ed67cc4f260e131ab6ee7f3e6f1176b8fc617d53a0f2f18e0c9e9a3f24e80
4
- data.tar.gz: 863a6f37118a9f3cdc39ad90cc9f8e7f87ed1c592f5b2e58657465cd8f7b0db9
3
+ metadata.gz: 5744548cd9ce6c76d9b75de1f19f31c1144df20e86517851eba5798cbc6f7751
4
+ data.tar.gz: 96f57a6d3a19bd9fa5a752932aef12ae19a6c00fafd96091e432a0e6ee06ee74
5
5
  SHA512:
6
- metadata.gz: 136e366b0598ff6b824d5b68fdeba950b495abab7f91d679cf6887884d8c0efa56d1f550eca13458fc108d4463c2835eba526dd9765ac0930f78e35f17613bd1
7
- data.tar.gz: 8914b19f0e1b7fcff74e30e5a356db5c2450bce3e4716c1e80248850f85816f64f2c36a6d6f94ac252a56c5369424bb54c42af94d87b22729dc2da82df57b162
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 - viewWidth / 4 - contentLeft,
6598
- y: position.y - viewHeight / 2 - contentTop
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);
@@ -1,5 +1,5 @@
1
1
  module Gobstones
2
2
  module Blockly
3
- VERSION = "0.15.0"
3
+ VERSION = "0.16.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gobstones-blockly
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.0
4
+ version: 0.16.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rodrigo Alfonso