Commit 9202acf
Fix AIOBE when calculating curve in TextMergeViewer
The TextMergeViewer currently assumes that the center canvas between the
two source code views always has a width of 34 points (exposed as
getCenterWidth()). This width is also assumed when calculating the curve
connecting regions between the two source viewers.
Even though that size for the center canvas is set by the used layout,
there is no guarantee that the size is an invariant that does always
hold. In particular, during a zoom change on Windows, the shell and its
controls are temporarily resized by the OS until the layout is applied
again, so that temporarily the size does not equal 34 points and a paint
operation can fail with an AIOBE.
This change adapts the curve calculation to adhere to the actual current
width of the canvas instead of assuming the size to be invariant.
Fixes #25841 parent 4d9d68a commit 9202acf
File tree
1 file changed
+8
-9
lines changed- team/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer
1 file changed
+8
-9
lines changedLines changed: 8 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4593 | 4593 | | |
4594 | 4594 | | |
4595 | 4595 | | |
4596 | | - | |
4597 | | - | |
| 4596 | + | |
| 4597 | + | |
| 4598 | + | |
4598 | 4599 | | |
4599 | 4600 | | |
4600 | 4601 | | |
4601 | | - | |
4602 | 4602 | | |
4603 | 4603 | | |
4604 | 4604 | | |
4605 | 4605 | | |
4606 | 4606 | | |
4607 | 4607 | | |
4608 | 4608 | | |
4609 | | - | |
4610 | | - | |
4611 | | - | |
4612 | | - | |
4613 | | - | |
4614 | | - | |
| 4609 | + | |
| 4610 | + | |
| 4611 | + | |
| 4612 | + | |
4615 | 4613 | | |
| 4614 | + | |
4616 | 4615 | | |
4617 | 4616 | | |
4618 | 4617 | | |
| |||
0 commit comments