Skip to content
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

[FIX] renderer: Fix Box rendering #5400

Open
wants to merge 1 commit into
base: 16.0
Choose a base branch
from

Conversation

rrahir
Copy link
Collaborator

@rrahir rrahir commented Jan 2, 2025

When we implemented the frozen panes, we accidently destroyed the
distinction between the actual size of a cell/merge and its visual
dimensio in the viewport. i.e. the dimension of the part that we be
rendered.

However, the rest of the rendering process was relying on the box size
to compute several things (button , text positions for instance)
This means that all computations taht relied on the actual size of a
cell/merge are now false.

A good example is the merge. Create a merge with some text inside of it
and make sure it spans over several columns.
The text is aligned at the center of the merge. Now scroll a bit and the
text will stay centered in the VISIBLE part of the merge but not the
merge itself.

On another hand, we did not account for some text formatting, specifically
text aligned on the right can overflow outside of their pane.

This revision fixes the two issues:

  • Reintroduce a getter getRect to properly compute the
    positiontioning of text/icons of a box
  • Change the rendering process of the grid by splitting the rendering
    one pane at a time and work in reverse such that a frozen pane takes
    precedence on the main viewport.

The second part of the approach is not the panacea as the mobile mode
will push the concept of frozen pane further but as a fix it suits well.

Task: 4448426

review checklist

  • feature is organized in plugin, or UI components
  • support of duplicate sheet (deep copy)
  • in model/core: ranges are Range object, and can be adapted (adaptRanges)
  • in model/UI: ranges are strings (to show the user)
  • undo-able commands (uses this.history.update)
  • multiuser-able commands (has inverse commands and transformations where needed)
  • new/updated/removed commands are documented
  • exportable in excel
  • translations (_t("qmsdf %s", abc))
  • unit tested
  • clean commented code
  • track breaking changes
  • doc is rebuild (npm run doc)
  • status is correct in Odoo

@robodoo
Copy link
Collaborator

robodoo commented Jan 2, 2025

Pull request status dashboard

@rrahir rrahir force-pushed the 16.0-fix-non-aligned-merge-text-rar branch 9 times, most recently from f89ead2 to f40408e Compare January 6, 2025 08:24
Copy link
Contributor

@hokolomopo hokolomopo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✈️

@@ -222,7 +222,7 @@ export class InternalViewport {
* @param zone
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typos in commit msg "dimensio", "taht"

Comment on lines +120 to +121
"context.rect(0, 0, 952, 974)",
"context.clip()",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would probably do a test that we clip what we dran on the frozen panes. It shouldn't be too annoying

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added some tests related to the renderer and he new getter 'getRect'. Not sure about the naming but 'getRenderingRect' was definitely wrong. it's more used as a computational tool.

@rrahir rrahir force-pushed the 16.0-fix-non-aligned-merge-text-rar branch from f40408e to 963a33d Compare January 7, 2025 08:36
When we implemented the frozen panes, we accidently destroyed the
distinction between the actual size of a cell/merge and its visual
dimension in the viewport. i.e. the dimension of the part that we be
rendered.

However, the rest of the rendering process was relying on the box size
to compute several things (button , text positions for instance)
This means that all computations that relied on the actual size of a
cell/merge are now false.

A good example is the merge. Create a merge with some text inside of it
and make sure it spans over several columns.
The text is aligned at the center of the merge. Now scroll a bit and the
text will stay centered in the VISIBLE part of the merge but not the
merge itself.

On another hand, we did not account for some text formatting, specifically
text aligned on the right can overflow outside of their pane.

This revision fixes the two issues:
- Reintroduce a getter `getRect` to properly compute the
  positiontioning of text/icons of a box
- Change the rendering process of the grid by splitting the rendering
  one pane at a time.

Task: 4448426
@rrahir rrahir force-pushed the 16.0-fix-non-aligned-merge-text-rar branch from 963a33d to 1695ab3 Compare January 7, 2025 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants