aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDevine Lu Linvega <[email protected]>2018-10-16 12:03:21 +1200
committerDevine Lu Linvega <[email protected]>2018-10-16 12:03:21 +1200
commit9f2f98eaee15952eea0d0274e7865d404dbdcc14 (patch)
tree9f8588b88e80d49d8d445f4fe39234582b5c88c5
parentd106e056de76c372fe79c1ed928bf7ad0a504e16 (diff)
downloadOrca-9f2f98eaee15952eea0d0274e7865d404dbdcc14.tar.gz
Orca-9f2f98eaee15952eea0d0274e7865d404dbdcc14.zip
Better scaling
-rw-r--r--README.md2
-rw-r--r--desktop/sources/scripts/terminal.js7
-rw-r--r--examples/blank_large.pico40
3 files changed, 47 insertions, 2 deletions
diff --git a/README.md b/README.md
index 9d54774..58e4438 100644
--- a/README.md
+++ b/README.md
@@ -88,8 +88,6 @@ The idea is to build a synth/mini sequencer, here's some tasks I need to tackle
[ ] custom synth functions, like `:SYN[ADSR](C)`
[ ] "I wanna be able to 1000x fastforward my pico programs"
[ ] sub programs scope
-[ ] block cut
-[ ] block delete
[ ] block add glyph
## Extras
diff --git a/desktop/sources/scripts/terminal.js b/desktop/sources/scripts/terminal.js
index 57ed064..9747e2f 100644
--- a/desktop/sources/scripts/terminal.js
+++ b/desktop/sources/scripts/terminal.js
@@ -33,6 +33,11 @@ function Terminal (pico) {
win.setSize((this.size.width * this.size.ratio) + 60, (this.size.height * this.size.ratio) + 30, true)
}
+ window.onresize = (event) => {
+ const marginTop = (window.innerHeight - (this.size.height * this.size.ratio))/2
+ this.el.style.marginTop = (marginTop-20)+'px'
+ };
+
this.start = function () {
this.theme.start()
this.pico.terminal = this
@@ -44,6 +49,7 @@ function Terminal (pico) {
}
this.setSpeed = function (bpm) {
+ bpm = clamp(bpm,100,300)
this.log(`Changed speed to ${bpm}.`)
const ms = (60000 / bpm) / 4
clearInterval(this.timer)
@@ -205,6 +211,7 @@ function Terminal (pico) {
}
ctx.fillText(styles.isCursor && g == '.' ? (!pico.is_paused ? '@' : '~') : g.toUpperCase(), (x + 0.5) * this.tile.w, (y + 1) * this.tile.h)
}
+ function clamp (v, min, max) { return v < min ? min : v > max ? max : v }
}
module.exports = Terminal
diff --git a/examples/blank_large.pico b/examples/blank_large.pico
new file mode 100644
index 0000000..5894811
--- /dev/null
+++ b/examples/blank_large.pico
@@ -0,0 +1,40 @@
+......................................................................................................................
+......................................................................................................................
+......................................................................................................................
+......................................................................................................................
+......................................................................................................................
+......................................................................................................................
+......................................................................................................................
+......................................................................................................................
+......................................................................................................................
+......................................................................................................................
+......................................................................................................................
+......................................................................................................................
+......................................................................................................................
+......................................................................................................................
+......................................................................................................................
+......................................................................................................................
+......................................................................................................................
+......................................................................................................................
+......................................................................................................................
+......................................................................................................................
+......................................................................................................................
+......................................................................................................................
+......................................................................................................................
+......................................................................................................................
+......................................................................................................................
+......................................................................................................................
+......................................................................................................................
+......................................................................................................................
+......................................................................................................................
+......................................................................................................................
+......................................................................................................................
+......................................................................................................................
+......................................................................................................................
+......................................................................................................................
+......................................................................................................................
+......................................................................................................................
+......................................................................................................................
+......................................................................................................................
+......................................................................................................................
+...................................................................................................................... \ No newline at end of file