Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
logging-scratch-gui
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Goessmann
logging-scratch-gui
Commits
43b1ae85
Commit
43b1ae85
authored
6 years ago
by
Paul Kaplan
Browse files
Options
Downloads
Patches
Plain Diff
Call renderer.draw after project loads to show the initial state
parent
9e783d8a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/containers/stage.jsx
+6
-0
6 additions, 0 deletions
src/containers/stage.jsx
src/lib/vm-manager-hoc.jsx
+11
-0
11 additions, 0 deletions
src/lib/vm-manager-hoc.jsx
with
17 additions
and
0 deletions
src/containers/stage.jsx
+
6
−
0
View file @
43b1ae85
...
...
@@ -59,6 +59,12 @@ class Stage extends React.Component {
this
.
canvas
=
document
.
createElement
(
'
canvas
'
);
this
.
renderer
=
new
Renderer
(
this
.
canvas
);
this
.
props
.
vm
.
attachRenderer
(
this
.
renderer
);
// Calling draw a single time before any project is loaded just makes
// the canvas white instead of solid black–needed because it is not
// possible to use CSS to style the canvas to have a different
// default color
this
.
props
.
vm
.
renderer
.
draw
();
}
this
.
props
.
vm
.
attachV2SVGAdapter
(
new
V2SVGAdapter
());
this
.
props
.
vm
.
attachV2BitmapAdapter
(
new
V2BitmapAdapter
());
...
...
This diff is collapsed.
Click to expand it.
src/lib/vm-manager-hoc.jsx
+
11
−
0
View file @
43b1ae85
...
...
@@ -53,6 +53,17 @@ const vmManagerHOC = function (WrappedComponent) {
return
this
.
props
.
vm
.
loadProject
(
this
.
props
.
projectData
)
.
then
(()
=>
{
this
.
props
.
onLoadedProject
(
this
.
props
.
loadingState
,
this
.
props
.
canSave
);
// If the vm is not running, call draw on the renderer manually
// This draws the state of the loaded project with no blocks running
// which closely matches the 2.0 behavior, except for monitors–
// 2.0 runs monitors and shows updates (e.g. timer monitor)
// before the VM starts running other hat blocks.
if
(
!
this
.
props
.
isStarted
)
{
// Wrap in a setTimeout because skin loading in
// the renderer can be async.
setTimeout
(()
=>
this
.
props
.
vm
.
renderer
.
draw
());
}
})
.
catch
(
e
=>
{
this
.
props
.
onError
(
e
);
...
...
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