mirror of
https://github.com/google/blockly.git
synced 2026-01-10 10:27:08 +01:00
Simplify workspace.getBlocksBoundingBox
Previously it returned x,y,width,height. Returning top,bottom,left,right results in simpler code, both in this function and in downstream callers. This commit makes the minumum change to the metrics_test. I’m happy to change the test’s data if that makes more sense.
This commit is contained in:
@@ -34,10 +34,10 @@ function makeMockWs(scale, x, y, width, height) {
|
||||
return {
|
||||
getBlocksBoundingBox: function() {
|
||||
return {
|
||||
width: width,
|
||||
height: height,
|
||||
x: x,
|
||||
y: y
|
||||
top: y,
|
||||
bottom: y + height,
|
||||
left: x,
|
||||
right: x + width
|
||||
}
|
||||
},
|
||||
scale: scale
|
||||
|
||||
Reference in New Issue
Block a user