layoutScene does a layout of the scene: Size, Position
()
| 93 | |
| 94 | // layoutScene does a layout of the scene: Size, Position |
| 95 | func (sc *Scene) layoutScene() { |
| 96 | if DebugSettings.LayoutTrace { |
| 97 | fmt.Println("\n############################\nLayoutScene SizeUp start:", sc) |
| 98 | } |
| 99 | sc.SizeUp() |
| 100 | sz := &sc.Geom.Size |
| 101 | sz.Alloc.Total.SetPoint(sc.sceneGeom.Size) |
| 102 | sz.setContentFromTotal(&sz.Alloc) |
| 103 | // sz.Actual = sz.Alloc // todo: is this needed?? |
| 104 | if DebugSettings.LayoutTrace { |
| 105 | fmt.Println("\n############################\nSizeDown start:", sc) |
| 106 | } |
| 107 | maxIter := 3 |
| 108 | for iter := 0; iter < maxIter; iter++ { // 3 > 2; 4 same as 3 |
| 109 | redo := sc.SizeDown(iter) |
| 110 | if redo && iter < maxIter-1 { |
| 111 | if DebugSettings.LayoutTrace { |
| 112 | fmt.Println("\n############################\nSizeDown redo:", sc, "iter:", iter+1) |
| 113 | } |
| 114 | } else { |
| 115 | break |
| 116 | } |
| 117 | } |
| 118 | if DebugSettings.LayoutTrace { |
| 119 | fmt.Println("\n############################\nSizeFinal start:", sc) |
| 120 | } |
| 121 | sc.SizeFinal() |
| 122 | if DebugSettings.LayoutTrace { |
| 123 | fmt.Println("\n############################\nPosition start:", sc) |
| 124 | } |
| 125 | sc.Position() |
| 126 | if DebugSettings.LayoutTrace { |
| 127 | fmt.Println("\n############################\nScenePos start:", sc) |
| 128 | } |
| 129 | sc.ApplyScenePos() |
| 130 | } |
| 131 | |
| 132 | // layoutRenderScene does a layout and render of the tree: |
| 133 | // GetSize, DoLayout, Render. Needed after Config. |
no test coverage detected