Clang formatting.

And unsaved editor tabs.
This commit is contained in:
Neil Fraser
2023-04-20 20:23:19 +02:00
parent 8c10c33d07
commit 2561005d19
4 changed files with 12 additions and 14 deletions
-2
View File
@@ -398,7 +398,6 @@ export class BlockSvg extends Block implements IASTNodeLocationSvg,
if (this.parentBlock_) {
throw Error('Block has parent');
}
reason || console.log('moveBy no reason');
const eventsEnabled = eventUtils.isEnabled();
let event: BlockMove|null = null;
if (eventsEnabled) {
@@ -469,7 +468,6 @@ export class BlockSvg extends Block implements IASTNodeLocationSvg,
* @param reason Why is this move happening? 'drag', 'bump', 'snap', ...
*/
moveTo(xy: Coordinate, reason?: string) {
reason || console.log('moveTo no reason');
const curXY = this.getRelativeToSurfaceXY();
this.moveBy(xy.x - curXY.x, xy.y - curXY.y, reason);
}
+8 -8
View File
@@ -68,14 +68,14 @@ export class BlockMove extends BlockBase {
/**
* An explanation of what this move is for. Known values include:
* 'drag' -- A drag operation completed.
* 'bump' -- Block got bumped away from an invalid connection.
* 'snap' -- Block got shifted to line up with the grid.
* 'inbounds' -- Block got pushed back into a non-scrolling workspace.
* 'connect' -- Block got connected to another block.
* 'disconnect' -- Block got disconnected from another block.
* 'create' -- Block created via XML.
* 'cleanup' -- Workspace aligned top-level blocks.
* 'drag' -- A drag operation completed.
* 'bump' -- Block got bumped away from an invalid connection.
* 'snap' -- Block got shifted to line up with the grid.
* 'inbounds' -- Block got pushed back into a non-scrolling workspace.
* 'connect' -- Block got connected to another block.
* 'disconnect' -- Block got disconnected from another block.
* 'create' -- Block created via XML.
* 'cleanup' -- Workspace aligned top-level blocks.
* Reasons may become comma separated if move events merge ('drag,bump,snap').
*/
reason?: string;
+2 -2
View File
@@ -291,9 +291,9 @@ export function filter(queueIn: Abstract[], forward: boolean): Abstract[] {
lastEvent.newInputName = moveEvent.newInputName;
lastEvent.newCoordinate = moveEvent.newCoordinate;
if (moveEvent.reason) {
// Contatenate reasons into a comma separated string
// without duplicates.
if (lastEvent.reason) {
// Contatenate reasons into a comma separated string
// without duplicates.
const reasonSet = new Set(moveEvent.reason.split(',').concat(
lastEvent.reason.split(',')));
lastEvent.reason = Array.from(reasonSet).join(',');
+2 -2
View File
@@ -433,8 +433,8 @@ export function domToWorkspace(xml: Element, workspace: Workspace): string[] {
const blockX = parseInt(xmlChildElement.getAttribute('x') ?? '10', 10);
const blockY = parseInt(xmlChildElement.getAttribute('y') ?? '10', 10);
if (!isNaN(blockX) && !isNaN(blockY)) {
block.moveBy(workspace.RTL ?
width - blockX : blockX, blockY, 'create');
block.moveBy(
workspace.RTL ? width - blockX : blockX, blockY, 'create');
}
variablesFirst = false;
} else if (name === 'shadow') {