Resizing OK!

This commit is contained in:
Wiwi Kuan
2019-04-05 01:38:56 +08:00
committed by GitHub
parent 08fb0ece28
commit f33cc6cc5d

View File

@@ -35,6 +35,7 @@ let detailText1 = [
"Bb 大調 / G 小調", "Bb 大調 / G 小調",
"F 大調 / D 小調" "F 大調 / D 小調"
] ]
let detailTextSize = 22;
let coreRatio = 0.57; let coreRatio = 0.57;
let coreType = "Detail"; let coreType = "Detail";
@@ -60,7 +61,7 @@ function preload() {
} }
function setup() { function setup() {
createCanvas(800, 800); createCanvas(400, 400);
ellipseMode(CENTER); ellipseMode(CENTER);
colorMode(HSB, 100); colorMode(HSB, 100);
//colors //colors
@@ -76,6 +77,11 @@ function setup() {
minorC2 = color(80, 30, 65); minorC2 = color(80, 30, 65);
minorCT = color(80, 10, 90); minorCT = color(80, 10, 90);
outTextSize = width * 0.01875;
majorTextSize = width * 0.0275;
minorTextSize = width * 0.02125;
detailTextSize = width * 0.0275;
lockButton = createButton('[Locked]'); lockButton = createButton('[Locked]');
lockButton.position(19, 19); lockButton.position(19, 19);
lockButton.mousePressed(toggleLocked); lockButton.mousePressed(toggleLocked);
@@ -205,7 +211,7 @@ function drawCoreDetail(ang) {
fill(20); fill(20);
noStroke(); noStroke();
textAlign(CENTER); textAlign(CENTER);
textSize(22); textSize(detailTextSize);
text(detailText1[highlighted()], 0, height * 0.1); text(detailText1[highlighted()], 0, height * 0.1);
imageMode(CENTER); imageMode(CENTER);
@@ -217,26 +223,26 @@ function drawCoreDetail(ang) {
case 5: case 5:
stroke(0); stroke(0);
strokeWeight(2); strokeWeight(width/400);
line(width * -0.008, height * -0.066, width * -0.008, height * 0.009); line(width * -0.008, height * -0.066, width * -0.008, height * 0.009);
strokeWeight(1); strokeWeight(width/800);
drawKeySig(5, -0.16, 1); drawKeySig(5, -0.16, 1);
drawKeySig(-7, 0.02, 1); drawKeySig(-7, 0.02, 1);
break; break;
case 6: case 6:
stroke(0); stroke(0);
strokeWeight(2); strokeWeight(width/400);
line(width * -0.008, height * -0.066, width * -0.008, height * 0.009); line(width * -0.008, height * -0.066, width * -0.008, height * 0.009);
strokeWeight(1); strokeWeight(width/800);
drawKeySig(6, -0.16, 1); drawKeySig(6, -0.16, 1);
drawKeySig(-6, 0.02, 1); drawKeySig(-6, 0.02, 1);
break; break;
case -5: case -5:
stroke(0); stroke(0);
strokeWeight(2); strokeWeight(width/400);
line(width * -0.008, height * -0.066, width * -0.008, height * 0.009); line(width * -0.008, height * -0.066, width * -0.008, height * 0.009);
strokeWeight(1); strokeWeight(width/800);
drawKeySig(7, -0.16, 1); drawKeySig(7, -0.16, 1);
drawKeySig(-5, 0.02, 1); drawKeySig(-5, 0.02, 1);
break; break;