Skip to content

Commit

Permalink
refactor: adjust this to store
Browse files Browse the repository at this point in the history
  • Loading branch information
weizhenye committed Jun 10, 2024
1 parent 9810733 commit 17d1f87
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
with:
node-version: 22
- name: Install Dependencies
run: npm i
run: npm i && npx playwright install
- name: Build
run: npm run build
- name: Test
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export function createDialogue(dialogue, store) {
cssText += tag.b ? `font-weight:${tag.b === 1 ? 'bold' : tag.b};` : '';
cssText += tag.i ? 'font-style:italic;' : '';
cssText += (tag.u || tag.s) ? `text-decoration:${tag.u ? 'underline' : ''} ${tag.s ? 'line-through' : ''};` : '';
cssText += tag.fsp ? `letter-spacing:${this.scale * tag.fsp}px;` : '';
cssText += tag.fsp ? `letter-spacing:${store.scale * tag.fsp}px;` : '';
// TODO: (tag.q === 0) and (tag.q === 3) are not implemented yet,
// for now just handle it as (tag.q === 1)
if (tag.q === 1 || tag.q === 0 || tag.q === 3) {
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export function renderer(dialogue, store) {

// Apply max width to the $div, to make sure it line breaks
// properly before measuring it:
const mw = this.width - this.scale * (dialogue.margin.left + dialogue.margin.right);
const mw = store.width - store.scale * (dialogue.margin.left + dialogue.margin.right);
$div.style.cssText = `max-width:${mw}px`;

store.box.append($div);
Expand Down

0 comments on commit 17d1f87

Please sign in to comment.