fixed swapping

This commit is contained in:
paul
2025-03-08 12:02:00 +05:30
parent 6aff8d37e4
commit aa54f9b0bb
3 changed files with 194 additions and 100 deletions

View File

@@ -118,8 +118,33 @@ export class TkinterBase extends Widget {
if (parentLayout === Layouts.FLEX || parentLayout === Layouts.GRID) {
// const elementRect = this.elementRef.current.getBoundingClientRect()
// const canvasInnerRect = this.props.canvasInnerContainerRef.current.getBoundingClientRect()
// const {zoom, pan} = this.props.canvasMetaData
// console.log("pan: ", pan, zoom)
// let pos = {
// x: ((elementRect.left - canvasInnerRect.left) - pan.x) / zoom ,
// y: ((elementRect.top - canvasInnerRect.top) - pan.y) / zoom
// }
// let parent = this.props.parentWidgetRef?.current;
// while (parent) {
// // accounting for nested parents
// const parentRect = parent.getBoundingRect()
// pos.x -= ((parentRect.left - canvasInnerRect.left) - pan.x) / zoom
// pos.y -= ((parentRect.top - canvasInnerRect.top) - pan.y) / zoom
// // Move up to the next parent (if any)
// parent = parent.parentWidgetRef?.current
// }
// // this.setPos(pos.x, pos.y)
// console.log("setting pos: ", pos, elementRect, canvasInnerRect)
updates = {
...updates,
// pos: pos,
positionType: PosType.NONE,
}
// Allow optional absolute positioning if the parent layout is flex or grid