Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Barafu committed Nov 3, 2024
1 parent ee3931f commit d1cee63
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ incremental = true # Compile your binary in smaller steps.

[profile.release]
codegen-units = 1 # Allows LLVM to perform better optimization.
lto = false # Enables link-time-optimizations.
lto = true # Enables link-time-optimizations.
opt-level = 2 # Prioritizes small binary size. Use `3` if you prefer speed.
panic = "abort" # Higher performance by disabling panic handlers.
strip = true # Ensures debug symbols are removed.
Expand Down
17 changes: 10 additions & 7 deletions src/dreams/dendraclock.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
let _performance_text: string = "Not set";
let performance_text: string = "Not set";
const SHOW_PERFORMANCE = false;

class Hand {
startX: number;
Expand Down Expand Up @@ -105,7 +106,7 @@ class AnalogClock {
class DendraClockPersistentOptions {
ZOOM = 0.25;
START_LINE_WIDTH = 10;
DEPTH = 8;
DEPTH = 4;
LENGTH_FACTOR = 0.9;
LUMINANCE_FACTOR = 0.9;
WIDTH_FACTOR = 0.7;
Expand Down Expand Up @@ -140,7 +141,7 @@ export function dendraClock(canvas: HTMLCanvasElement) {
// ===== Calculate stage =====
// Calculate all arms positions and save them to hands_map
const now = new Date();
let clock_tasks: ClockTask[] = [];
let clock_tasks: ClockTask[] = [];

clock_tasks.push(new ClockTask(canvas.width / 2, canvas.height / 2, 0, 0));

Expand Down Expand Up @@ -200,9 +201,11 @@ export function dendraClock(canvas: HTMLCanvasElement) {
}
ctx.stroke();
}
// ctx.fillStyle = "yellow";
// ctx.font = "20px serif";
// ctx.fillText(performance_text, 10, 20);
if (SHOW_PERFORMANCE) {
ctx.fillStyle = "yellow";
ctx.font = "20px serif";
ctx.fillText(performance_text, 10, 20);
}
ctx.fillStyle = "black";
ctx.fillRect(0, 0, canvas.width, canvas.height);
const draw_timestamp = performance.now();
Expand Down Expand Up @@ -262,7 +265,7 @@ function performanses(start: DOMHighResTimeStamp, calc: DOMHighResTimeStamp, dra
const calc_perf = process_stage(stage_calc);
const draw_perf = process_stage(stage_draw);

_performance_text = `Calculation: ${calc_perf.toFixed(2)}hz, Drawing: ${draw_perf.toFixed(2)}hz`;
performance_text = `Calculation: ${calc_perf.toFixed(2)}hz, Drawing: ${draw_perf.toFixed(2)}hz`;

stage_calc.length = 0;
stage_draw.length = 0;
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

/* Linting */
"strict": true,
"noUnusedLocals": false,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
},
Expand Down

0 comments on commit d1cee63

Please sign in to comment.