gobstones-blockly 0.14.0 → 0.15.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: efc62cae32139ee99bb562e651eb6ba89a6d951ed809f74633372e3b0dfb9500
4
- data.tar.gz: 9f4e4a8a846bcc7339418f322d74bc6d650c7b258e006b5c4be82673e681ab70
3
+ metadata.gz: 986ed67cc4f260e131ab6ee7f3e6f1176b8fc617d53a0f2f18e0c9e9a3f24e80
4
+ data.tar.gz: 863a6f37118a9f3cdc39ad90cc9f8e7f87ed1c592f5b2e58657465cd8f7b0db9
5
5
  SHA512:
6
- metadata.gz: cc93803172019e95760e98104637b3ac11a80efaac9ee1bf6a4056fcd6809bc2570a3a7c76afdbaa7ff5da435ed9d79f341ab7cf9900615a9e80c6c7764ec5d0
7
- data.tar.gz: e133fd4084f30f191daf2e491cc92873ca49d3af9519b5ae782424d3504cbf964127d820ed465dc3dd1dc59c90e966d12a8129930ef67a58d9eae42134c21031
6
+ metadata.gz: 136e366b0598ff6b824d5b68fdeba950b495abab7f91d679cf6887884d8c0efa56d1f550eca13458fc108d4463c2835eba526dd9765ac0930f78e35f17613bd1
7
+ data.tar.gz: 8914b19f0e1b7fcff74e30e5a356db5c2450bce3e4716c1e80248850f85816f64f2c36a6d6f94ac252a56c5369424bb54c42af94d87b22729dc2da82df57b162
@@ -6584,6 +6584,23 @@ Blockly.ErrorInforming.CssContent = [
6584
6584
  this.workspace.showBlockError(blockId, errorKind);
6585
6585
  },
6586
6586
 
6587
+ scrollToBlock: function(blockId) {
6588
+ const block = blockId
6589
+ ? this.workspace.getBlockById(blockId)
6590
+ : this.workspace.getAllBlocks().find((it) => it.type === "Program");
6591
+ if (!block) return;
6592
+
6593
+ const position = block.getRelativeToSurfaceXY();
6594
+ const { viewLeft, contentLeft, viewTop, contentTop, viewWidth, viewHeight } = this.workspace.getMetrics();
6595
+
6596
+ const finalPosition = {
6597
+ x: position.x - viewWidth / 4 - contentLeft,
6598
+ y: position.y - viewHeight / 2 - contentTop
6599
+ };
6600
+
6601
+ this.workspace.scrollbar.set(finalPosition.x, finalPosition.y);
6602
+ },
6603
+
6587
6604
  testColors(colors) {
6588
6605
  Blockly.CUSTOM_COLORS = colors;
6589
6606
  Blockly.HSV_SATURATION = colors.globalHsvSaturation;
@@ -1,5 +1,5 @@
1
1
  module Gobstones
2
2
  module Blockly
3
- VERSION = "0.14.0"
3
+ VERSION = "0.15.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gobstones-blockly
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.0
4
+ version: 0.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rodrigo Alfonso
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-23 00:00:00.000000000 Z
11
+ date: 2018-05-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler