From 14dbd944f93b4612cdc2aa4d614e00da5e2c5ea7 Mon Sep 17 00:00:00 2001 From: MrKBear Date: Thu, 31 Mar 2022 21:57:08 +0800 Subject: [PATCH] Optmi behavior list style --- source/Component/BehaviorList/BehaviorList.scss | 15 +++++++++------ source/Component/BehaviorList/BehaviorList.tsx | 2 +- source/Model/Actuator.ts | 14 +++++++------- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/source/Component/BehaviorList/BehaviorList.scss b/source/Component/BehaviorList/BehaviorList.scss index e351881..364421b 100644 --- a/source/Component/BehaviorList/BehaviorList.scss +++ b/source/Component/BehaviorList/BehaviorList.scss @@ -12,6 +12,7 @@ div.behavior-list { height: 45px; user-select: none; border-radius: 3px; + overflow: hidden; cursor: pointer; div.behavior-color-view { @@ -19,12 +20,14 @@ div.behavior-list { width: 100%; div { - position: relative; - top: 5px; - left: 5px; - width: 8px; - height: 8px; - border-radius: 8px; + // position: relative; + // top: 5px; + // left: 5px; + width: 0; + height: 0; + // border-left: 8px solid red; + border-bottom: 12px solid transparent; + // border-radius: 8px; } } diff --git a/source/Component/BehaviorList/BehaviorList.tsx b/source/Component/BehaviorList/BehaviorList.tsx index 2fc5521..46fdcdd 100644 --- a/source/Component/BehaviorList/BehaviorList.tsx +++ b/source/Component/BehaviorList/BehaviorList.tsx @@ -113,7 +113,7 @@ class BehaviorList extends Component { }} >
-
+
diff --git a/source/Model/Actuator.ts b/source/Model/Actuator.ts index 64e93b5..6c0e914 100644 --- a/source/Model/Actuator.ts +++ b/source/Model/Actuator.ts @@ -69,13 +69,13 @@ class Actuator extends Emitter { // 丢帧判定 if (durTime > 0.1) { console.log("Actuator: Ticker dur time error. dropping...") - } - - this.alignTimer += durTime; - if (this.alignTimer > (1 / this.fps)) { - this.model.update(this.alignTimer * this.speed); - this.emit("loop", this.alignTimer); - this.alignTimer = 0; + } else { + this.alignTimer += durTime; + if (this.alignTimer > (1 / this.fps)) { + this.model.update(this.alignTimer * this.speed); + this.emit("loop", this.alignTimer); + this.alignTimer = 0; + } } } } else {