diff options
| author | jsheridan <17163297+jooshkins@users.noreply.github.com> | 2023-03-31 11:01:47 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-31 17:01:47 +0200 |
| commit | e5847cfafb4c8244b964876852c620d2dfa7669b (patch) | |
| tree | f974ebda9db29e185cfd4e9bccac1e08945c2d0c /electron/src | |
| parent | d3fba192aeea38e0524fbd1f1526edc533098a38 (diff) | |
Feature - Page Preview for Simulator (#2174)
Authored-by: jooshkins
Diffstat (limited to 'electron/src')
| -rw-r--r-- | electron/src/renderer/assets/js/simulator.js | 19 | ||||
| -rw-r--r-- | electron/src/renderer/assets/style/simulator.css | 2 |
2 files changed, 20 insertions, 1 deletions
diff --git a/electron/src/renderer/assets/js/simulator.js b/electron/src/renderer/assets/js/simulator.js index fa963bbe..0e60e1c2 100644 --- a/electron/src/renderer/assets/js/simulator.js +++ b/electron/src/renderer/assets/js/simulator.js @@ -508,6 +508,18 @@ export default { prevStitch = stitch }) }) + }, + generatePage () { + this.$refs.simulator.style.backgroundColor = this.page_specs.deskcolor + this.svg.rect(this.page_specs.width, this.page_specs.height) + .move(-this.stitchPlan.bounding_box[0],-this.stitchPlan.bounding_box[1]) + .fill(this.page_specs.pagecolor) + .stroke({width: 1, color: 'black'}) + .filterWith(add => { + let blur = add.offset(2,2).in(add.$sourceAlpha).gaussianBlur(2) + add.blend(add.$source, blur) + }) + .back() } }, created: function () { @@ -530,6 +542,7 @@ export default { this.jumpMarks = {} this.needlePenetrationPoints = [] this.cursor = null + this.page_specs = {} }, mounted: function () { this.svg = SVG().addTo(this.$refs.simulator).size('100%', '100%').panZoom({zoomMin: 0.1}) @@ -581,7 +594,7 @@ export default { this.generateColorSections() this.generateScale() this.generateCursor() - + this.loading = false // v-on:keydown doesn't seem to work, maybe an Electron issue? @@ -600,5 +613,9 @@ export default { this.start() }) + inkStitch.get('page_specs').then(response => { + this.page_specs = response.data + this.generatePage() + }) } } diff --git a/electron/src/renderer/assets/style/simulator.css b/electron/src/renderer/assets/style/simulator.css index 6358bc4d..64047a7e 100644 --- a/electron/src/renderer/assets/style/simulator.css +++ b/electron/src/renderer/assets/style/simulator.css @@ -86,6 +86,7 @@ fieldset { position: relative; padding: 0 5px; font-size: 90%; + background-color: white; } .window-controls { @@ -289,6 +290,7 @@ div.simulator::v-deep svg.simulation { flex-grow: 1; flex-shrink: 1; order: -2; + margin-bottom: -48px; } div.simulator::v-deep svg.simulation-scale { |
