-
Notifications
You must be signed in to change notification settings - Fork 82
[201_85]: Prevent matrix/det from being resized by mouse drag #2858
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
divyansharma001
wants to merge
1
commit into
MoganLab:main
Choose a base branch
from
divyansharma001:divyansharma001/201_85/fix_matrix_det_resize
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+39
−5
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,21 @@ | ||
| # [201_85] Matrices and determinants should not be resizable by mouse drag | ||
|
|
||
| ## How to Test | ||
| 1. Insert a matrix (`Insert` -> `Table` -> `Matrix`) and click inside it | ||
| 2. Verify that no resize handles appear around the matrix | ||
| 3. Hover over the internal grid lines of the matrix — the cursor should remain normal (no resize cursor) | ||
| 4. Try dragging a grid line inside the matrix — it should not resize | ||
| 5. Repeat the above for `det`, `bmatrix`, `Bmatrix`, `choice`, and `stack` | ||
| 6. Insert a normal table (`Insert` -> `Table` -> `Plain tabular`) — resize handles and line dragging should still work as before | ||
|
|
||
| ## Issue | ||
| #2783 — Matrices and determinants can be resized by dragging the mouse, which should not be allowed. | ||
|
|
||
| ## 2026/2/25 | ||
| ### What | ||
| The table resizing feature (drag grid lines, scale handles) was incorrectly applying to mathematical table environments like `matrix`, `det`, `bmatrix`, `Bmatrix`, `choice`, and `stack`. These are mathematical constructs where resizing by mouse drag is not meaningful. | ||
|
|
||
| ### How | ||
| 1. In `edit_interface.cpp`, added `matrix`, `matrix*`, `bmatrix`, `Bmatrix`, `det`, `choice`, and `stack` to the `is_true_table` exclusion list. This prevents scale resize handles from appearing on these math table types (the handle drawing code already checks `is_true_table`). | ||
| 2. In `edit_mouse.cpp` `table_line_start`, added an `is_true_table` guard so that internal grid line dragging is blocked for math tables. | ||
| 3. In `edit_mouse.cpp` `mouse_any`, added an `is_true_table` check before setting the `hovering_table` cursor style, so the resize cursor (↔/↕) no longer appears when hovering over matrix/det grid lines. |
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fix is missing several commonly used matrix types that should also be excluded from resizing:
pmatrix(parentheses matrix),vmatrix(vertical bar determinant),Vmatrix(double vertical bar matrix), andsmallmatrix(inline matrix). These are standard LaTeX matrix environments that should not be resizable, just likematrix,bmatrix, andBmatrix.