mirror of
https://github.com/google/blockly.git
synced 2026-01-10 02:17:09 +01:00
Handle RTL
This commit is contained in:
@@ -1515,10 +1515,13 @@ Blockly.WorkspaceSvg.prototype.centerOnBlock = function(id) {
|
||||
// Height/width is in workspace units.
|
||||
var heightWidth = block.getHeightWidth();
|
||||
|
||||
// Center in workspace units.
|
||||
var blockCenterX = xy.x + heightWidth.width / 2;
|
||||
// Find the enter of the block in workspace units.
|
||||
var blockCenterY = xy.y + heightWidth.height / 2;
|
||||
|
||||
// In RTL the block's position is the top right of the block, not top left.
|
||||
var multiplier = this.RTL ? -1 : 1;
|
||||
var blockCenterX = xy.x + (multiplier * heightWidth.width / 2);
|
||||
|
||||
// Workspace scale, used to convert from workspace coordinates to pixels.
|
||||
var scale = this.scale;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user