mirror of
https://github.com/unanmed/HumanBreak.git
synced 2026-11-02 17:44:31 +08:00
fix: 画面清晰度
This commit is contained in:
1 parent
f796e93240
commit
9628d7acb7
4 files changed
+16
-12
No files matched your search
@@ -990,7 +990,6 @@ export class TextContentParser {
|
||||
data.splitLines.push(this.wordBreak[index]);
|
||||
this.lineHeights.push(this.lineHeight);
|
||||
this.lineWidths.push(this.lineWidth);
|
||||
this.bsStart = index;
|
||||
const text = data.text.slice(
|
||||
this.wordBreak[index] + 1,
|
||||
pointer + 1
|
||||
@@ -1002,10 +1001,11 @@ export class TextContentParser {
|
||||
}
|
||||
maxWidth = width;
|
||||
const metrics = ctx.measureText(text);
|
||||
if (metrics.width < maxWidth) {
|
||||
if (metrics.width < maxWidth || index === this.bsStart) {
|
||||
this.lastBreakIndex = index;
|
||||
break;
|
||||
}
|
||||
this.bsStart = index;
|
||||
}
|
||||
this.lineWidth = 0;
|
||||
this.lineStart = pointer;
|
||||
@@ -1092,7 +1092,6 @@ export class TextContentParser {
|
||||
data.splitLines.push(this.wordBreak[index]);
|
||||
this.lineHeights.push(this.lineHeight);
|
||||
this.lineWidths.push(this.lineWidth);
|
||||
this.bsStart = index;
|
||||
const text = data.text.slice(this.wordBreak[index] + 1);
|
||||
if (!isLast && text.length < guess / 4) {
|
||||
// 如果剩余文字很少,几乎不可能会单独成一行时,直接结束循环
|
||||
@@ -1101,10 +1100,11 @@ export class TextContentParser {
|
||||
}
|
||||
const metrics = ctx.measureText(text);
|
||||
maxWidth = width;
|
||||
if (metrics.width < maxWidth) {
|
||||
if (metrics.width < maxWidth || index === this.bsStart) {
|
||||
this.lastBreakIndex = index;
|
||||
break;
|
||||
}
|
||||
this.bsStart = index;
|
||||
}
|
||||
this.lineWidth = 0;
|
||||
return true;
|
||||
|
||||
@@ -628,13 +628,13 @@ export class Layer extends Container<ELayerEvent> {
|
||||
this.size(core._PX_, core._PY_);
|
||||
|
||||
this.staticMap.setHD(false);
|
||||
// this.staticMap.setAntiAliasing(false);
|
||||
this.staticMap.setAntiAliasing(false);
|
||||
this.staticMap.size(core._PX_, core._PY_);
|
||||
this.movingMap.setHD(false);
|
||||
// this.movingMap.setAntiAliasing(false);
|
||||
this.movingMap.setAntiAliasing(false);
|
||||
this.movingMap.size(core._PX_, core._PY_);
|
||||
this.backMap.setHD(false);
|
||||
// this.backMap.setAntiAliasing(false);
|
||||
this.backMap.setAntiAliasing(false);
|
||||
this.backMap.size(core._PX_, core._PY_);
|
||||
this.main.setAntiAliasing(false);
|
||||
this.main.setHD(false);
|
||||
@@ -778,11 +778,11 @@ export class Layer extends Container<ELayerEvent> {
|
||||
if (!data) return;
|
||||
|
||||
const frame = data.frame;
|
||||
const temp = this.requireCanvas();
|
||||
const temp = this.requireCanvas(true, false);
|
||||
temp.setHD(false);
|
||||
temp.setAntiAliasing(false);
|
||||
for (let i = 0; i < frame; i++) {
|
||||
const canvas = this.requireCanvas();
|
||||
const canvas = this.requireCanvas(true, false);
|
||||
const ctx = canvas.ctx;
|
||||
const tempCtx = temp.ctx;
|
||||
const [sx, sy, w, h] = data.render[i];
|
||||
@@ -1198,7 +1198,7 @@ export class Layer extends Container<ELayerEvent> {
|
||||
const ex = Math.min(sx + blockSize, this.mapWidth);
|
||||
const ey = Math.min(sy + blockSize, this.mapHeight);
|
||||
|
||||
const temp = this.requireCanvas();
|
||||
const temp = this.requireCanvas(true, false);
|
||||
temp.setAntiAliasing(false);
|
||||
temp.setHD(false);
|
||||
temp.size(core._PX_, core._PY_);
|
||||
|
||||
@@ -179,7 +179,7 @@ export class Winskin extends RenderItem<EWinskinEvent> {
|
||||
}
|
||||
|
||||
private generatePattern() {
|
||||
const pattern = this.requireCanvas();
|
||||
const pattern = this.requireCanvas(true, false);
|
||||
pattern.setScale(1);
|
||||
const img = this.image;
|
||||
pattern.size(32, 16);
|
||||
|
||||
Reference in new issue
Block a user