Skip to content
Snippets Groups Projects
Commit 5c566918 authored by Lucas Lefèvre's avatar Lucas Lefèvre
Browse files

[FIX] spreadsheet: update o_spreadsheet to latest version

### Contains the following commits:

https://github.com/odoo/o-spreadsheet/commit/f83585f2

 [FIX] InternalViewport: compute the actual visible rect of a zone

closes odoo/odoo#106578

Signed-off-by: default avatarPierre Rousseau (pro) <pro@odoo.com>
parent 46636f23
No related branches found
No related tags found
No related merge requests found
......@@ -5204,20 +5204,13 @@
}
const dataSets = [zoneToXc(dataSetZone)];
const sheetId = getters.getActiveSheetId();
const { x: offsetCorrectionX, y: offsetCorrectionY } = getters.getMainViewportCoordinates();
const { offsetX, offsetY } = getters.getActiveSheetScrollInfo();
const { width, height } = getters.getSheetViewDimension();
const size = { width: DEFAULT_FIGURE_WIDTH, height: DEFAULT_FIGURE_HEIGHT };
const rect = getters.getVisibleRect(getters.getActiveMainViewport());
const scrollableViewportWidth = Math.min(rect.width, width - offsetCorrectionX);
const scrollableViewportHeight = Math.min(rect.height, height - offsetCorrectionY);
const { x, y } = getters.getMainViewportCoordinates();
const { offsetX, offsetY } = getters.getActiveSheetScrollInfo();
const { width, height } = getters.getVisibleRect(getters.getActiveMainViewport());
const position = {
x: offsetCorrectionX +
offsetX +
Math.max(0, (scrollableViewportWidth - DEFAULT_FIGURE_WIDTH) / 2),
y: offsetCorrectionY +
offsetY +
Math.max(0, (scrollableViewportHeight - DEFAULT_FIGURE_HEIGHT) / 2),
x: x + offsetX + Math.max(0, (width - size.width) / 2),
y: y + offsetY + Math.max(0, (height - size.height) / 2),
}; // Position at the center of the scrollable viewport
let title = "";
const cells = env.model.getters.getCellsInZone(sheetId, {
......@@ -35260,16 +35253,24 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
this.adjustViewportZoneX();
this.adjustViewportZoneY();
}
/**
*
* @param zone
* @returns Computes the absolute coordinate of a given zone inside the viewport
*/
getRect(zone) {
const targetZone = intersection(zone, this.zone);
if (targetZone) {
const x = this.getters.getColRowOffset("COL", this.zone.left, targetZone.left) +
this.offsetCorrectionX;
const y = this.getters.getColRowOffset("ROW", this.zone.top, targetZone.top) + this.offsetCorrectionY;
const width = Math.min(this.getters.getColRowOffset("COL", targetZone.left, targetZone.right + 1), this.width);
const height = Math.min(this.getters.getColRowOffset("ROW", targetZone.top, targetZone.bottom + 1), this.height);
return {
x: this.getters.getColRowOffset("COL", this.zone.left, targetZone.left) +
this.offsetCorrectionX,
y: this.getters.getColRowOffset("ROW", this.zone.top, targetZone.top) +
this.offsetCorrectionY,
width: this.getters.getColRowOffset("COL", targetZone.left, targetZone.right + 1),
height: this.getters.getColRowOffset("ROW", targetZone.top, targetZone.bottom + 1),
x,
y,
width,
height,
};
}
else {
......@@ -42054,8 +42055,8 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
Object.defineProperty(exports, '__esModule', { value: true });
 
exports.__info__.version = '2.0.0';
exports.__info__.date = '2022-11-24T09:38:39.745Z';
exports.__info__.hash = 'b167b3e';
exports.__info__.date = '2022-11-25T14:49:18.608Z';
exports.__info__.hash = 'f83585f';
 
})(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
//# sourceMappingURL=o_spreadsheet.js.map
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment