mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-15 14:18:04 +08:00
Fix 'Jitter Points' and 'Sample Polylines' working incorrectly with X or Y scale of 0 content (#3984)
* Fix NaN points produced by Sample Polylines on 0-scaled input * Fix Jitter Points inverse transform for zero-scale axes and stop resetting stroke transform * Remove a couple confusing Debug nodes * Fix edge case * Update demo art * Fix order change in Jitter Points causing different results from earlier * Fix bug in bisect tool * Break out functionality into helper functions
This commit is contained in:
@@ -214,6 +214,36 @@ document.addEventListener("DOMContentLoaded", () => {
|
||||
commits = fetched;
|
||||
}
|
||||
|
||||
async function extendCommitsForward() {
|
||||
if (commits.length === 0) return false;
|
||||
|
||||
const newest = commits[commits.length - 1];
|
||||
const since = new Date(newest.date.getTime() + 1000).toISOString();
|
||||
|
||||
let /** @type {any[]} */ allRaw = [];
|
||||
let page = 1;
|
||||
|
||||
while (true) {
|
||||
const raw = await fetchCommitList(since, undefined, page);
|
||||
if (!raw || raw.length === 0) break;
|
||||
allRaw = allRaw.concat(raw);
|
||||
if (raw.length < 100) break;
|
||||
page++;
|
||||
}
|
||||
|
||||
if (allRaw.length === 0) return false;
|
||||
|
||||
let fetched = parseCommits(allRaw);
|
||||
fetched.reverse();
|
||||
|
||||
const existingShas = new Set(commits.map((c) => c.sha));
|
||||
fetched = fetched.filter((c) => !existingShas.has(c.sha));
|
||||
if (fetched.length === 0) return false;
|
||||
|
||||
commits = [...commits, ...fetched];
|
||||
return true;
|
||||
}
|
||||
|
||||
async function extendCommitsBackward() {
|
||||
if (commits.length === 0) return false;
|
||||
|
||||
@@ -340,8 +370,9 @@ document.addEventListener("DOMContentLoaded", () => {
|
||||
badIndex = currentIndex;
|
||||
boundarySearching = true;
|
||||
} else {
|
||||
// Absent at starting commit. The newest commit should have it (user assumes master has it).
|
||||
// Absent at starting commit, so the issue was introduced more recently. Extend the commit list forward (towards HEAD) before narrowing.
|
||||
goodIndex = currentIndex;
|
||||
await extendCommitsForward();
|
||||
badIndex = commits.length - 1;
|
||||
bisectPhase = "binary";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user