Skip to content

Commit

Permalink
fix: block was not dropping at correct positon in canva
Browse files Browse the repository at this point in the history
  • Loading branch information
SyntaxGalaxy committed Jan 26, 2025
1 parent f7698ac commit 6269b38
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,8 @@ public void dropBlock(float x, float y) {
LogicEditorCanvaView.LayoutParams.WRAP_CONTENT);

newZone.addActionBlocksBeans(blocks, 0);
newZone.setX(x);
newZone.setY(y);
newZone.setX(x + binding.logicEditorCanvaView.getScrollX());
newZone.setY(y + binding.logicEditorCanvaView.getScrollY());
getLogicEditorCanva().addView(newZone);
blockDropZones.add(newZone);
newZone.setLayoutParams(lp);
Expand All @@ -262,8 +262,8 @@ public void dropBlock(float x, float y) {
LogicEditorCanvaView.LayoutParams.WRAP_CONTENT);

newZone.addActionBlocksBeans(blocks, 0);
newZone.setX(x);
newZone.setY(y);
newZone.setX(x + binding.logicEditorCanvaView.getScrollX());
newZone.setY(y + binding.logicEditorCanvaView.getScrollY());
getLogicEditorCanva().addView(newZone);
blockDropZones.add(newZone);
newZone.setLayoutParams(lp);
Expand Down

0 comments on commit 6269b38

Please sign in to comment.