diff --git a/src/grid/actions/gridFile/GridFileSchema.ts b/src/grid/actions/gridFile/GridFileSchema.ts index dad8299256..5fb9bc01fd 100644 --- a/src/grid/actions/gridFile/GridFileSchema.ts +++ b/src/grid/actions/gridFile/GridFileSchema.ts @@ -14,4 +14,5 @@ export interface GridFileSchemaV1 { borders: Border[]; render_dependency: Dependency[]; cell_dependency: string; + version: '1.0'; } diff --git a/src/grid/sheet/Sheet.ts b/src/grid/sheet/Sheet.ts index f2b3e6ec55..52013b4c93 100644 --- a/src/grid/sheet/Sheet.ts +++ b/src/grid/sheet/Sheet.ts @@ -53,6 +53,7 @@ export class Sheet { borders: this.borders.getArray(), render_dependency: this.render_dependency.save(), cell_dependency: this.cell_dependency.exportToString(), + version: '1.0', }; } diff --git a/src/gridGL/UI/cells/Cells.ts b/src/gridGL/UI/cells/Cells.ts index f2e62d53c1..34e1544e05 100644 --- a/src/gridGL/UI/cells/Cells.ts +++ b/src/gridGL/UI/cells/Cells.ts @@ -156,7 +156,7 @@ export class Cells extends Container { this.cellsBorder.draw({ ...entry, x, y, width, height }); } if (this.app.settings.showCellTypeOutlines && entry.cell?.array_cells) { - this.cellsArray.draw(entry.cell.array_cells, x, y, width, height); + this.cellsArray.draw(entry.cell.array_cells, x, y, width, height, entry.cell.type); } if (hasContent) { diff --git a/src/gridGL/UI/cells/CellsArray.ts b/src/gridGL/UI/cells/CellsArray.ts index 66bb83f3af..a31735a7f4 100644 --- a/src/gridGL/UI/cells/CellsArray.ts +++ b/src/gridGL/UI/cells/CellsArray.ts @@ -1,4 +1,5 @@ import { Container, Sprite, Texture } from 'pixi.js'; +import { CellTypes } from '../../../grid/sheet/gridTypes'; import { colors } from '../../../theme/colors'; import { PixiApp } from '../../pixiApp/PixiApp'; import { drawBorder } from './drawBorder'; @@ -28,7 +29,7 @@ export class CellsArray extends Container { return this.addChild(new Sprite(Texture.WHITE)); }; - draw(cellArray: number[][], x: number, y: number, width: number, height: number): void { + draw(cellArray: number[][], x: number, y: number, width: number, height: number, type: CellTypes): void { const { gridOffsets } = this.app.sheet; // calculate array cells outline size @@ -43,8 +44,13 @@ export class CellsArray extends Container { } drawBorder({ - tint: colors.cellColorUserPython, - alpha: 0.25, + tint: + type === 'PYTHON' + ? colors.cellColorUserPython + : type === 'FORMULA' + ? colors.cellColorUserFormula + : colors.independence, + alpha: 0.5, x, y, width: xEnd - x, @@ -56,19 +62,19 @@ export class CellsArray extends Container { right: true, }); - drawBorder({ - tint: colors.cellColorUserPython, - alpha: 0.25, - x, - y, - width, - height, - getSprite: this.getSprite, - top: true, - left: true, - bottom: true, - right: true, - }); + // drawBorder({ + // tint: colors.cellColorUserPython, + // alpha: 0.25, + // x, + // y, + // width, + // height, + // getSprite: this.getSprite, + // top: true, + // left: true, + // bottom: true, + // right: true, + // }); } debugShowCachedCounts(): void { diff --git a/src/gridGL/UI/cells/CellsBorder.ts b/src/gridGL/UI/cells/CellsBorder.ts index 05bf106141..995fd21249 100644 --- a/src/gridGL/UI/cells/CellsBorder.ts +++ b/src/gridGL/UI/cells/CellsBorder.ts @@ -71,13 +71,13 @@ export class CellsBorder extends Container { if (input.cell && this.app.settings.showCellTypeOutlines) { // Change outline color based on cell type if (input.cell.type === 'TEXT') { - drawInputBorder(input, colors.cellColorUserText, 0.75); + // drawInputBorder(input, colors.cellColorUserText, 0.75); } else if (input.cell.type === 'PYTHON') { drawInputBorder(input, colors.cellColorUserPython, 0.75); } else if (input.cell.type === 'FORMULA') { drawInputBorder(input, colors.cellColorUserFormula, 0.75); } else if (input.cell.type === 'COMPUTED') { - drawInputBorder(input, colors.independence, 0.75); + // drawInputBorder(input, colors.independence, 0.75); } } } diff --git a/src/quadratic/example_grid.ts b/src/quadratic/example_grid.ts index 2b1aa352c8..e844a59ddd 100644 --- a/src/quadratic/example_grid.ts +++ b/src/quadratic/example_grid.ts @@ -1,6 +1,7 @@ import { GridFileSchemaV1 } from '../grid/actions/gridFile/GridFileSchema'; export const example_grid: GridFileSchemaV1 = { + version: '1.0', columns: [{ id: 0, size: 275.9100338070991 }], rows: [], cells: [