* Copy position and size properties from one widget to another. * Copies x, y, w, h and optionally min/max constraints. * * @param a target widget to copy to * @param b source widget to copy from * @param doMinMax if true, also copy min/max width/height constraints * @returns the t
(a: GridStackWidget, b: GridStackWidget, doMinMax = false)
| 472 | * Utils.copyPos(widget1, widget2, true); // Also copy constraints |
| 473 | */ |
| 474 | static copyPos(a: GridStackWidget, b: GridStackWidget, doMinMax = false): GridStackWidget { |
| 475 | if (b.x !== undefined) a.x = b.x; |
| 476 | if (b.y !== undefined) a.y = b.y; |
| 477 | if (b.w !== undefined) a.w = b.w; |
| 478 | if (b.h !== undefined) a.h = b.h; |
| 479 | if (doMinMax) { |
| 480 | if (b.minW) a.minW = b.minW; |
| 481 | if (b.minH) a.minH = b.minH; |
| 482 | if (b.maxW) a.maxW = b.maxW; |
| 483 | if (b.maxH) a.maxH = b.maxH; |
| 484 | } |
| 485 | return a; |
| 486 | } |
| 487 | |
| 488 | /** true if a and b has same size & position */ |
| 489 | static samePos(a: GridStackPosition, b: GridStackPosition): boolean { |
no outgoing calls
no test coverage detected