Skip to content

Commit

Permalink
Fix hatch line thickness
Browse files Browse the repository at this point in the history
  • Loading branch information
dev7355608 committed May 28, 2024
1 parent 8422388 commit e39e30e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
6 changes: 3 additions & 3 deletions module.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"email": "[email protected]"
}
],
"version": "1.1.2",
"version": "1.1.3",
"compatibility": {
"minimum": "10",
"verified": "12"
Expand All @@ -18,8 +18,8 @@
],
"url": "https://github.com/dev7355608/gm-vision",
"manifest": "https://github.com/dev7355608/gm-vision/releases/latest/download/module.json",
"download": "https://github.com/dev7355608/gm-vision/releases/download/v1.1.2/module.zip",
"changelog": "https://github.com/dev7355608/gm-vision/releases/tag/v1.1.2",
"download": "https://github.com/dev7355608/gm-vision/releases/download/v1.1.3/module.zip",
"changelog": "https://github.com/dev7355608/gm-vision/releases/tag/v1.1.3",
"bugs": "https://github.com/dev7355608/gm-vision/issues",
"readme": "https://raw.githubusercontent.com/dev7355608/gm-vision/main/README.md",
"license": "https://raw.githubusercontent.com/dev7355608/gm-vision/main/LICENSE"
Expand Down
11 changes: 4 additions & 7 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Hooks.once("init", () => {

active = value;

if (foundry.utils.isNewerVersion(game.version, 12)) {
if (game.release.generation >= 12) {
canvas.perception.update({ refreshVision: true });
} else {
canvas.perception.update({ refreshVision: true }, true);
Expand Down Expand Up @@ -90,9 +90,6 @@ Hooks.once("init", () => {
CONFIG.Token.objectClass = class extends CONFIG.Token.objectClass {
/** @override */
get isVisible() {
// Fixes #9521 in V10
this.detectionFilter = undefined;

const visible = super.isVisible;

if (!visible && active || visible && this.document.hidden) {
Expand Down Expand Up @@ -123,7 +120,7 @@ Hooks.once("init", () => {
vTextureCoord = (aVertexPosition * outputFrame.zw) * inputSize.zw;
vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.0)) + outputFrame.xy;
vec2 offset = position - origin;
vOffset = (offset.x + offset.y) / (2.0 * thickness);
vOffset = (offset.x + offset.y) / (1.414213562373095 * 2.0 * thickness);
gl_Position = vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);
}
`;
Expand Down Expand Up @@ -167,7 +164,7 @@ Hooks.once("init", () => {

const hatchFilter = HatchFilter.create();

if (foundry.utils.isNewerVersion(game.version, 12)) {
if (game.release.generation >= 12) {
Hooks.on("drawCanvasDarknessEffects", (layer) => {
const index = layer.filters?.indexOf(layer.filter);

Expand Down Expand Up @@ -233,7 +230,7 @@ Hooks.once("init", () => {
}
};

if (foundry.utils.isNewerVersion(game.version, 11)) {
if (game.release.generation >= 11) {
Hooks.once("setup", setup);
} else {
Hooks.once("setup", () => {
Expand Down

0 comments on commit e39e30e

Please sign in to comment.