-
Notifications
You must be signed in to change notification settings - Fork 323
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
Pan to CB (#9273)
When the CB is opened, pan to show it. Large screen: <video src="https://github.com/enso-org/enso/assets/1047859/1a07c8cc-5818-420a-9fb3-1d1cb308cb87"> Small screen: <video src="https://github.com/enso-org/enso/assets/1047859/a9f18df5-c0ca-426c-959a-bda5cd077541"> # Important Notes A prioritized-coordinates approach is used to adjust panning goals based on screen space: - Fitting the input area is highest-priority. - If possible, the whole component panel area will be fit. - If possible, the visualization preview will be fit. - If there's extra room, margins will be included; the top and left are prioritized because those margins prevent overlap with fixed UI elements.
- 2024.6.1-nightly.2024.12.30
- 2024.6.1-nightly.2024.12.29
- 2024.6.1-nightly.2024.12.28
- 2024.6.1-nightly.2024.12.27
- 2024.6.1-nightly.2024.12.26
- 2024.6.1-nightly.2024.12.25
- 2024.6.1-nightly.2024.12.24
- 2024.6.1-nightly.2024.12.23
- 2024.6.1-nightly.2024.12.22
- 2024.6.1-nightly.2024.12.21
- 2024.6.1-nightly.2024.12.20
- 2024.5.2
- 2024.5.1
- 2024.5.1-rc7
- 2024.5.1-rc6
- 2024.5.1-rc5
- 2024.5.1-rc4
- 2024.5.1-rc3
- 2024.5.1-rc2
- 2024.5.1-rc1
- 2024.5.1-nightly.2024.12.16
- 2024.5.1-nightly.2024.12.15
- 2024.5.1-nightly.2024.12.14
- 2024.5.1-nightly.2024.12.13
- 2024.5.1-nightly.2024.12.12
- 2024.5.1-nightly.2024.12.11
- 2024.5.1-nightly.2024.12.10
- 2024.5.1-nightly.2024.12.9
- 2024.5.1-nightly.2024.12.7
- 2024.5.1-nightly.2024.12.6
- 2024.5.1-nightly.2024.12.5
- 2024.5.1-nightly.2024.12.4
- 2024.5.1-nightly.2024.12.3
- 2024.5.1-nightly.2024.11.29
- 2024.5.1-nightly.2024.11.28
- 2024.5.1-nightly.2024.11.27
- 2024.5.1-nightly.2024.11.26.1
- 2024.5.1-nightly.2024.11.26
- 2024.5.1-nightly.2024.11.25
- 2024.5.1-nightly.2024.11.24
- 2024.5.1-nightly.2024.11.23
- 2024.5.1-nightly.2024.11.22
- 2024.5.1-nightly.2024.11.21
- 2024.5.1-nightly.2024.11.20
- 2024.5.1-nightly.2024.11.19
- 2024.5.1-nightly.2024.11.18
- 2024.5.1-nightly.2024.11.17
- 2024.5.1-nightly.2024.11.16
- 2024.5.1-nightly.2024.11.15
- 2024.5.1-nightly.2024.11.14.1
- 2024.5.1-nightly.2024.11.14
- 2024.5.1-nightly.2024.11.13
- 2024.5.1-nightly.2024.11.11
- 2024.5.1-nightly.2024.11.5
- 2024.5.1-nightly.2024.11.4
- 2024.5.1-nightly.2024.11.3
- 2024.5.1-nightly.2024.11.2
- 2024.5.1-nightly.2024.11.1
- 2024.5.1-nightly.2024.10.31
- 2024.5.1-nightly.2024.10.30
- 2024.5.1-nightly.2024.10.29
- 2024.5.1-nightly.2024.10.28
- 2024.5.1-nightly.2024.10.27
- 2024.5.1-nightly.2024.10.26
- 2024.5.1-nightly.2024.10.25
- 2024.5.1-nightly.2024.10.24
- 2024.5.1-nightly.2024.10.23
- 2024.5.1-nightly.2024.10.22
- 2024.5.1-nightly.2024.10.21
- 2024.5.1-nightly.2024.10.20
- 2024.5.1-nightly.2024.10.19
- 2024.5.1-nightly.2024.10.18
- 2024.5.1-nightly.2024.10.17
- 2024.5.1-nightly.2024.10.16
- 2024.5.1-nightly.2024.10.15
- 2024.5.1-nightly.2024.10.14
- 2024.5.1-nightly.2024.10.13
- 2024.5.1-nightly.2024.10.12
- 2024.5.1-nightly.2024.10.11
- 2024.5.1-nightly.2024.10.10
- 2024.5.1-nightly.2024.10.9
- 2024.5.1-nightly.2024.10.8
- 2024.5.1-nightly.2024.10.7
- 2024.5.1-nightly.2024.10.6
- 2024.5.1-nightly.2024.10.5
- 2024.5.1-nightly.2024.10.4
- 2024.5.1-nightly.2024.10.3
- 2024.5.1-nightly.2024.10.2
- 2024.5.1-nightly.2024.10.1
- 2024.5.1-nightly.2024.9.30
- 2024.5.1-nightly.2024.9.29
- 2024.5.1-nightly.2024.9.28
- 2024.5.1-nightly.2024.9.27
- 2024.5.1-nightly.2024.9.26
- 2024.5.1-nightly.2024.9.25
- 2024.5.1-nightly.2024.9.24.1
- 2024.5.1-nightly.2024.9.24
- 2024.5.1-nightly.2024.9.23
- 2024.5.1-nightly.2024.9.22
- 2024.5.1-nightly.2024.9.21
- 2024.5.1-nightly.2024.9.20
- 2024.5.1-nightly.2024.9.18
- 2024.4.2
- 2024.4.2-rc2
- 2024.4.2-rc1
- 2024.4.1
- 2024.4.1-rc8
- 2024.4.1-rc7
- 2024.4.1-rc6
- 2024.4.1-rc5
- 2024.4.1-rc4
- 2024.4.1-rc3
- 2024.4.1-rc2
- 2024.4.1-rc1
- 2024.4.1-nightly.2024.9.17
- 2024.4.1-nightly.2024.9.16
- 2024.4.1-nightly.2024.9.15
- 2024.4.1-nightly.2024.9.14
- 2024.4.1-nightly.2024.9.11
- 2024.4.1-nightly.2024.9.10
- 2024.4.1-nightly.2024.9.7
- 2024.4.1-nightly.2024.9.6
- 2024.4.1-nightly.2024.9.5
- 2024.4.1-nightly.2024.9.4
- 2024.4.1-nightly.2024.9.3
- 2024.4.1-nightly.2024.9.2
- 2024.4.1-nightly.2024.8.31.1
- 2024.4.1-nightly.2024.8.31
- 2024.4.1-nightly.2024.8.30
- 2024.4.1-nightly.2024.8.28
- 2024.4.1-nightly.2024.8.27
- 2024.4.1-nightly.2024.8.26
- 2024.4.1-nightly.2024.8.23
- 2024.4.1-nightly.2024.8.21
- 2024.4.1-nightly.2024.8.20
- 2024.4.1-nightly.2024.8.19
- 2024.4.1-nightly.2024.8.18
- 2024.4.1-nightly.2024.8.17
- 2024.4.1-nightly.2024.8.16
- 2024.4.1-nightly.2024.8.15
- 2024.4.1-nightly.2024.8.14
- 2024.4.1-nightly.2024.8.13
- 2024.4.1-nightly.2024.8.7
- 2024.4.1-nightly.2024.8.6
- 2024.4.1-nightly.2024.8.5
- 2024.4.1-nightly.2024.8.4
- 2024.4.1-nightly.2024.8.2
- 2024.4.1-nightly.2024.8.1
- 2024.3.1
- 2024.3.1-rc5
- 2024.3.1-rc4
- 2024.3.1-rc3
- 2024.3.1-rc2
- 2024.3.1-rc1
- 2024.3.1-nightly.2024.7.31
- 2024.3.1-nightly.2024.7.30
- 2024.3.1-nightly.2024.7.29
- 2024.3.1-nightly.2024.7.28
- 2024.3.1-nightly.2024.7.27
- 2024.3.1-nightly.2024.7.26
- 2024.3.1-nightly.2024.7.25
- 2024.3.1-nightly.2024.7.24
- 2024.3.1-nightly.2024.7.23
- 2024.3.1-nightly.2024.7.22
- 2024.3.1-nightly.2024.7.21
- 2024.3.1-nightly.2024.7.20
- 2024.3.1-nightly.2024.7.19
- 2024.3.1-nightly.2024.7.18
- 2024.3.1-nightly.2024.7.17
- 2024.3.1-nightly.2024.7.16
- 2024.3.1-nightly.2024.7.15
- 2024.3.1-nightly.2024.7.14
- 2024.3.1-nightly.2024.7.13
- 2024.3.1-nightly.2024.7.12.1
- 2024.3.1-nightly.2024.7.12
- 2024.3.1-nightly.2024.7.11.1
- 2024.3.1-nightly.2024.7.11
- 2024.3.1-nightly.2024.7.10
- 2024.3.1-nightly.2024.7.9
- 2024.3.1-nightly.2024.7.8
- 2024.3.1-nightly.2024.7.7
- 2024.3.1-nightly.2024.7.6
- 2024.3.1-nightly.2024.7.5
- 2024.3.1-nightly.2024.7.4
- 2024.3.1-nightly.2024.7.3
- 2024.2.3
- 2024.2.2
- 2024.2.1
- 2024.2.1-rc1
- 2024.2.1-nightly.2024.7.2
- 2024.2.1-nightly.2024.7.1
- 2024.2.1-nightly.2024.6.30
- 2024.2.1-nightly.2024.6.29
- 2024.2.1-nightly.2024.6.28
- 2024.2.1-nightly.2024.6.27
- 2024.2.1-nightly.2024.6.26
- 2024.2.1-nightly.2024.6.25
- 2024.2.1-nightly.2024.6.24
- 2024.2.1-nightly.2024.6.23
- 2024.2.1-nightly.2024.6.22
- 2024.2.1-nightly.2024.6.21
- 2024.2.1-nightly.2024.6.19
- 2024.2.1-nightly.2024.6.18
- 2024.2.1-nightly.2024.6.17
- 2024.2.1-nightly.2024.6.14
- 2024.2.1-nightly.2024.6.13
- 2024.2.1-nightly.2024.6.12
- 2024.2.1-nightly.2024.6.11
- 2024.1.1
- 2024.1.1-rc.2
- 2024.1.1-rc.1
- 2024.1.1-nightly.2024.6.10
- 2024.1.1-nightly.2024.6.9
- 2024.1.1-nightly.2024.6.8
- 2024.1.1-nightly.2024.6.7
- 2024.1.1-nightly.2024.6.6
- 2024.1.1-nightly.2024.6.5
- 2024.1.1-nightly.2024.6.4
- 2024.1.1-nightly.2024.6.3
- 2024.1.1-nightly.2024.6.2
- 2024.1.1-nightly.2024.6.1
- 2024.1.1-nightly.2024.5.31
- 2024.1.1-nightly.2024.5.30
- 2024.1.1-nightly.2024.5.29
- 2024.1.1-nightly.2024.5.28
- 2024.1.1-nightly.2024.5.27
- 2024.1.1-nightly.2024.5.26
- 2024.1.1-nightly.2024.5.25
- 2024.1.1-nightly.2024.5.24
- 2024.1.1-nightly.2024.5.23
- 2024.1.1-nightly.2024.5.22
- 2024.1.1-nightly.2024.5.21
- 2024.1.1-nightly.2024.5.20
- 2024.1.1-nightly.2024.5.19
- 2024.1.1-nightly.2024.5.18
- 2024.1.1-nightly.2024.5.17
- 2024.1.1-nightly.2024.5.16
- 2024.1.1-nightly.2024.5.15
- 2024.1.1-nightly.2024.5.14
- 2024.1.1-nightly.2024.5.11
- 2024.1.1-nightly.2024.5.10
- 2024.1.1-nightly.2024.5.9
- 2024.1.1-nightly.2024.5.8
- 2024.1.1-nightly.2024.5.7.1
- 2024.1.1-nightly.2024.5.7
- 2024.1.1-nightly.2024.5.6
- 2024.1.1-nightly.2024.5.5
- 2024.1.1-nightly.2024.5.4
- 2024.1.1-nightly.2024.5.3
- 2024.1.1-nightly.2024.5.2
- 2024.1.1-nightly.2024.5.1
- 2024.1.1-nightly.2024.4.30
- 2024.1.1-nightly.2024.4.29
- 2024.1.1-nightly.2024.4.26
- 2024.1.1-nightly.2024.4.24
- 2024.1.1-nightly.2024.4.22
- 2024.1.1-nightly.2024.4.20
- 2024.1.1-nightly.2024.4.19
- 2024.1.1-nightly.2024.4.18
- 2024.1.1-nightly.2024.4.17
- 2024.1.1-nightly.2024.4.15
- 2024.1.1-nightly.2024.4.14
- 2024.1.1-nightly.2024.4.13
- 2024.1.1-nightly.2024.4.12
- 2024.1.1-nightly.2024.4.11
- 2024.1.1-nightly.2024.4.10
- 2024.1.1-nightly.2024.4.9
- 2024.1.1-nightly.2024.4.8
- 2024.1.1-nightly.2024.4.7
- 2024.1.1-nightly.2024.4.6
- 2024.1.1-nightly.2024.4.4.1
- 2024.1.1-nightly.2024.4.4
- 2024.1.1-nightly.2024.4.3
- 2024.1.1-nightly.2024.4.2
- 2024.1.1-nightly.2024.4.1
- 2024.1.1-nightly.2024.3.31
- 2024.1.1-nightly.2024.3.30
- 2024.1.1-nightly.2024.3.29
- 2024.1.1-nightly.2024.3.28
- 2024.1.1-nightly.2024.3.27
- 2024.1.1-nightly.2024.3.26
- 2024.1.1-nightly.2024.3.25
- 2024.1.1-nightly.2024.3.24
- 2024.1.1-nightly.2024.3.23
- 2024.1.1-nightly.2024.3.22
- 2024.1.1-nightly.2024.3.20
- 2024.1.1-nightly.2024.3.19
- 2024.1.1-nightly.2024.3.18
- 2024.1.1-nightly.2024.3.16
- 2024.1.1-nightly.2024.3.15
- 2024.1.1-nightly.2024.3.14
- 2024.1.1-nightly.2024.3.13
- 2024.1.1-nightly.2024.3.12
- 2024.1.1-nightly.2024.3.11.1
- 2024.1.1-nightly.2024.3.11
- 2024.1.1-nightly.2024.3.10
- 2024.1.1-nightly.2024.3.8
- 2024.1.1-nightly.2024.3.7
Showing
6 changed files
with
179 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { Rect } from '@/util/data/rect' | ||
import { Vec2 } from '@/util/data/vec2' | ||
import { fc, test } from '@fast-check/vitest' | ||
import { expect } from 'vitest' | ||
|
||
test.prop({ | ||
rectX: fc.nat(), | ||
rectY: fc.nat(), | ||
width: fc.nat(), | ||
height: fc.nat(), | ||
x: fc.nat(), | ||
y: fc.nat(), | ||
})('offsetToInclude', ({ rectX, rectY, width, height, x, y }) => { | ||
const rect = new Rect(new Vec2(rectX, rectY), new Vec2(width, height)) | ||
const point = new Vec2(x, y) | ||
const offsetRect = rect.offsetToInclude(point) | ||
expect( | ||
offsetRect === undefined, | ||
'`offsetToInclude` returns `undefined` iffi the original `Rect` contains the point.', | ||
).toBe(rect.contains(point)) | ||
if (offsetRect === undefined) return | ||
expect( | ||
offsetRect.size === rect.size, | ||
'The result of `offsetToInclude` is the same size as the input `Rect`.', | ||
) | ||
expect(offsetRect.contains(point), 'The result of `offsetToInclude` contains the point.') | ||
const dx = Math.max(0, rect.left - point.x, point.x - rect.right) | ||
const dy = Math.max(0, rect.top - point.y, point.y - rect.bottom) | ||
expect( | ||
Math.abs(offsetRect.left - rect.left), | ||
'`offsetToInclude` has shifted the `Rect` by the minimum distance that reaches the point on the x-axis.', | ||
).toBe(dx) | ||
expect( | ||
Math.abs(offsetRect.top - rect.top), | ||
'`offsetToInclude` has shifted the `Rect` by the minimum distance that reaches the point on the y-axis.', | ||
).toBe(dy) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters