MCPcopy
hub / github.com/RaspberryPiFoundation/blockly / from

Method from

packages/blockly/core/utils/rect.ts:41–43  ·  view source on GitHub ↗

* Converts a DOM or SVG Rect to a Blockly Rect. * * @param rect The rectangle to convert. * @returns A representation of the same rectangle as a Blockly Rect.

(rect: DOMRect | SVGRect)

Source from the content-addressed store, hash-verified

39 * @returns A representation of the same rectangle as a Blockly Rect.
40 */
41 static from(rect: DOMRect | SVGRect): Rect {
42 return new Rect(rect.y, rect.y + rect.height, rect.x, rect.x + rect.width);
43 }
44
45 /**
46 * Creates a new copy of this rectangle.

Callers 15

getVariableTypesMethod · 0.80
allUsedVarModelsFunction · 0.80
allDeveloperVariablesFunction · 0.80
blockToDomFunction · 0.80
getUserNamesMethod · 0.80
handleTouchStartMethod · 0.80
handlePinchMethod · 0.80
saveAttributesFunction · 0.80
filterFunction · 0.80
onNodeFocusMethod · 0.80
getSizeFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected