@xpadev-net/niconicomments 0.2.59 → 0.2.61

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/bundle.js +6 -6
  2. package/package.json +17 -17
package/dist/bundle.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- niconicomments.js v0.2.59
2
+ niconicomments.js v0.2.61
3
3
  (c) 2021 xpadev-net https://xpadev.net
4
4
  Released under the MIT License.
5
5
  */
@@ -645,7 +645,7 @@
645
645
  });
646
646
  };
647
647
  const processNicoscript = (comment, commands) => {
648
- const nicoscript = RegExp(/^[@\uff20](.*)(?:\s(.+))?/).exec(comment.content);
648
+ const nicoscript = RegExp(/^[@\uff20](\S+)(?:\s(.+))?/).exec(comment.content);
649
649
  if (!nicoscript)
650
650
  return;
651
651
  if (nicoscript[1] === "\u30dc\u30bf\u30f3" && nicoscript[2]) {
@@ -2275,20 +2275,20 @@
2275
2275
  const { fontSize, scale } = getFontSizeAndScale(this.comment.charSize);
2276
2276
  const paddingTop = (10 - scale * 10) *
2277
2277
  ((this.comment.lineCount + 1) / config.hiResCommentCorrection);
2278
+ const drawScale = getConfig(config.commentScale, false) *
2279
+ scale *
2280
+ (this.comment.layer === -1 ? options.scale : 1);
2278
2281
  const { image, context } = this.createCanvas();
2279
2282
  image.width = this.comment.width + 2 * 2 * this.comment.charSize;
2280
2283
  image.height =
2281
2284
  this.comment.height +
2282
- ((paddingTop + 1) * this.comment.lineHeight) / scale;
2285
+ (((paddingTop + 1) * this.comment.lineHeight) / scale) * drawScale;
2283
2286
  context.strokeStyle = getStrokeColor(this.comment);
2284
2287
  context.fillStyle = this.comment.color;
2285
2288
  context.textAlign = "start";
2286
2289
  context.textBaseline = "alphabetic";
2287
2290
  context.lineWidth = getConfig(config.contextLineWidth, false);
2288
2291
  context.font = parseFont(this.comment.font, fontSize);
2289
- const drawScale = getConfig(config.commentScale, false) *
2290
- scale *
2291
- (this.comment.layer === -1 ? options.scale : 1);
2292
2292
  context.scale(drawScale, drawScale);
2293
2293
  let lineCount = 0;
2294
2294
  if (!typeGuard.internal.HTML5Fonts(this.comment.font))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xpadev-net/niconicomments",
3
- "version": "0.2.59",
3
+ "version": "0.2.61",
4
4
  "description": "NiconiComments is a comment drawing library that is somewhat compatible with the official Nico Nico Douga player.",
5
5
  "main": "dist/bundle.js",
6
6
  "types": "dist/bundle.d.ts",
@@ -44,20 +44,20 @@
44
44
  "homepage": "https://xpadev-net.github.io/niconicomments/",
45
45
  "license": "MIT",
46
46
  "devDependencies": {
47
- "@babel/core": "^7.23.0",
48
- "@babel/preset-env": "^7.22.20",
49
- "@playwright/test": "^1.38.1",
50
- "@rollup/plugin-babel": "^6.0.3",
51
- "@rollup/plugin-commonjs": "^25.0.4",
52
- "@rollup/plugin-json": "^6.0.0",
53
- "@rollup/plugin-node-resolve": "^15.2.1",
54
- "@rollup/plugin-typescript": "^11.1.4",
55
- "@types/node": "^20.7.0",
56
- "@typescript-eslint/eslint-plugin": "^6.7.3",
57
- "@typescript-eslint/parser": "^6.7.3",
47
+ "@babel/core": "^7.23.2",
48
+ "@babel/preset-env": "^7.23.2",
49
+ "@playwright/test": "^1.39.0",
50
+ "@rollup/plugin-babel": "^6.0.4",
51
+ "@rollup/plugin-commonjs": "^25.0.7",
52
+ "@rollup/plugin-json": "^6.0.1",
53
+ "@rollup/plugin-node-resolve": "^15.2.3",
54
+ "@rollup/plugin-typescript": "^11.1.5",
55
+ "@types/node": "^20.8.7",
56
+ "@typescript-eslint/eslint-plugin": "^6.8.0",
57
+ "@typescript-eslint/parser": "^6.8.0",
58
58
  "concurrently": "^8.2.1",
59
59
  "copyfiles": "^2.4.1",
60
- "eslint": "^8.50.0",
60
+ "eslint": "^8.51.0",
61
61
  "eslint-config-prettier": "^9.0.0",
62
62
  "eslint-plugin-jsdoc": "^46.8.2",
63
63
  "eslint-plugin-simple-import-sort": "^10.0.0",
@@ -65,12 +65,12 @@
65
65
  "lint-staged": "^14.0.1",
66
66
  "lite-server": "^2.6.1",
67
67
  "prettier": "^3.0.3",
68
- "rimraf": "^5.0.4",
69
- "rollup": "^3.29.3",
70
- "rollup-plugin-dts": "^6.0.2",
68
+ "rimraf": "^5.0.5",
69
+ "rollup": "^3.29.4",
70
+ "rollup-plugin-dts": "^6.1.0",
71
71
  "rollup-plugin-typescript-paths": "^1.4.0",
72
72
  "tslib": "^2.6.2",
73
- "typedoc": "^0.25.1",
73
+ "typedoc": "^0.25.2",
74
74
  "typedoc-plugin-missing-exports": "^2.1.0",
75
75
  "typescript": "^5.2.2"
76
76
  }