Skip to content

Instantly share code, notes, and snippets.

View zxch3n's full-sized avatar
🎯
Focusing

Zixuan Chen zxch3n

🎯
Focusing
View GitHub Profile
function layoutSubtree(node, children) {
if (children.length == 0) {
return;
}
const prev = [children[0]];
let iyl = new IYL(getBottom(children[0]), 0, null);
for (let i = 1; i < children.length; i++) {
const cur = children[i];
const [distance, collideIndex] = getMoveDistance(prev, cur, iyl);

Keybase proof

I hereby claim:

  • I am zxch3n on github.
  • I am zixuanchen (https://keybase.io/zixuanchen) on keybase.
  • I have a public key ASCYdUwpW-Fb45FU1oc1tUvj-kjF6fF0GA8By70-LKTULwo

To claim this, I am signing this object:

TypeScript 18 hrs 52 mins █████████████░░░░░░░ 65.9%
JavaScript 3 hrs 13 mins ██░░░░░░░░░░░░░░░░░░ 11.3%
HTML 2 hrs 23 mins █▓░░░░░░░░░░░░░░░░░░ 8.3%
Rust 1 hr 58 mins █▒░░░░░░░░░░░░░░░░░░ 6.9%
@zxch3n
zxch3n / ChromeCanvasBug.html
Created August 17, 2020 13:57
Sourcecode to reproduce chrome bug: a large number of canvas element would cause chrome unstable
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<canvas id="canvas" width="1000px" height="1000px"></canvas>
<script>