Skip to content

Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.

fix(sheet): fill text blur (#947)

Univer5d04d928e258
diff --git a/packages/engine-render/src/context.ts b/packages/engine-render/src/context.ts
index 54663a7945..a5ade8ab39 100644
--- a/packages/engine-render/src/context.ts
+++ b/packages/engine-render/src/context.ts
@@ -612,6 +612,28 @@ export class UniverContext2D implements CanvasRenderingContext2D {
*/
fillText(text: string, x: number, y: number, maxWidth?: number) {
+ // const { scaleX, scaleY } = this._getScale();
+ // x = fixLineWidthByScale(x, scaleX);
+ // y = fixLineWidthByScale(y, scaleY);
+
+ if (maxWidth) {
+ // maxWidth = fixLineWidthByScale(maxWidth, scaleX);
+
+ this._context.fillText(text, x, y, maxWidth);
+ } else {
+ this._context.fillText(text, x, y);
+ }
+ }
+
+ /**
+
+ * fillText function.
+
+ * @method
+
+ */
+
+ fillTextPrecision(text: string, x: number, y: number, maxWidth?: number) {
const { scaleX, scaleY } = this._getScale();
x = fixLineWidthByScale(x, scaleX);
y = fixLineWidthByScale(y, scaleY);