Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Molstar
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Michal Malý
Molstar
Commits
93ea759a
Commit
93ea759a
authored
5 years ago
by
Alexander Rose
Browse files
Options
Downloads
Patches
Plain Diff
StateTreeSpine.current tweaks
parent
3e50377e
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/mol-state/state.ts
+2
-2
2 additions, 2 deletions
src/mol-state/state.ts
src/mol-state/tree/spine.ts
+8
-8
8 additions, 8 deletions
src/mol-state/tree/spine.ts
with
10 additions
and
10 deletions
src/mol-state/state.ts
+
2
−
2
View file @
93ea759a
...
...
@@ -162,7 +162,7 @@ class State {
return
cell
&&
cell
.
obj
;
}
}
finally
{
this
.
spine
.
setC
urrent
()
;
this
.
spine
.
c
urrent
=
undefined
;
if
(
updated
)
this
.
events
.
changed
.
next
();
this
.
events
.
isUpdating
.
next
(
false
);
...
...
@@ -607,7 +607,7 @@ async function updateNode(ctx: UpdateContext, currentRef: Ref): Promise<UpdateNo
throw
new
Error
(
`No suitable parent found for '
${
currentRef
}
'`
);
}
ctx
.
spine
.
setC
urrent
(
current
)
;
ctx
.
spine
.
c
urrent
=
current
;
const
parent
=
parentCell
.
obj
!
;
current
.
sourceRef
=
parentCell
.
transform
.
ref
;
...
...
This diff is collapsed.
Click to expand it.
src/mol-state/tree/spine.ts
+
8
−
8
View file @
93ea759a
...
...
@@ -18,14 +18,14 @@ interface StateTreeSpine {
namespace
StateTreeSpine
{
export
class
Impl
implements
StateTreeSpine
{
private
current
:
StateObjectCell
|
undefined
=
void
0
;
setCurrent
(
cell
?:
StateObjectCell
)
{
this
.
current
=
cell
;
}
private
_
current
:
StateObjectCell
|
undefined
=
void
0
;
get
current
()
{
return
this
.
_
current
;
}
set
current
(
cell
:
StateObjectCell
|
undefined
)
{
this
.
_current
=
cell
;
}
getAncestorOfType
<
T
extends
StateObject
.
Ctor
>
(
t
:
T
):
StateObject
.
From
<
T
>
|
undefined
{
if
(
!
this
.
current
)
return
void
0
;
let
cell
=
this
.
current
;
if
(
!
this
.
_
current
)
return
void
0
;
let
cell
=
this
.
_
current
;
while
(
true
)
{
cell
=
this
.
cells
.
get
(
cell
.
transform
.
parent
)
!
;
if
(
!
cell
.
obj
)
return
void
0
;
...
...
@@ -35,8 +35,8 @@ namespace StateTreeSpine {
}
getRootOfType
<
T
extends
StateObject
.
Ctor
>
(
t
:
T
):
StateObject
.
From
<
T
>
|
undefined
{
if
(
!
this
.
current
)
return
void
0
;
let
cell
=
this
.
current
;
if
(
!
this
.
_
current
)
return
void
0
;
let
cell
=
this
.
_
current
;
let
ret
:
StateObjectCell
|
undefined
=
void
0
;
while
(
true
)
{
cell
=
this
.
cells
.
get
(
cell
.
transform
.
parent
)
!
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment