Limit horizontal scaling in sub-titles

This commit is contained in:
LoveEevee 2018-11-10 23:10:48 +03:00
parent b6552ea25f
commit 7d91721ce8
2 changed files with 4 additions and 3 deletions

View File

@ -10,7 +10,7 @@ Still in developement. Works best with Chrome.
Create a SQLite databse named `taiko.db` with the following schema:
CREATE TABLE "songs" ( `id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, `title` TEXT NOT NULL, `title_en` TEXT, `easy` INTEGER, `normal` INTEGER, `hard` INTEGER, `oni` INTEGER, `ura` INTEGER, `enabled` INTEGER NOT NULL, `category` INTEGER, `type` TEXT , `offset` REAL NOT NULL )
CREATE TABLE "songs" ( `id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, `title` TEXT NOT NULL, `title_en` TEXT, `subtitle` TEXT, `subtitle_en` TEXT, `easy` INTEGER, `normal` INTEGER, `hard` INTEGER, `oni` INTEGER, `ura` INTEGER, `enabled` INTEGER NOT NULL, `category` INTEGER, `type` TEXT , `offset` REAL NOT NULL )
CREATE TABLE "categories" ( `id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, `title` TEXT NOT NULL, `title_en` TEXT NOT NULL )
When inserting song rows, leave any difficulty columns as NULL if you don't intend to add notecharts for them.

View File

@ -394,12 +394,13 @@
var scaling = 1
if(config.height && drawnHeight > config.height){
scaling = config.height / drawnHeight
if(config.align === "bottom"){
scaling = Math.max(0.6, config.height / drawnHeight)
ctx.translate(40 * mul, 0)
ctx.scale(scaling, scaling)
ctx.scale(scaling, config.height / drawnHeight)
ctx.translate(-40 * mul, 0)
}else{
scaling = config.height / drawnHeight
ctx.scale(1, scaling)
}
if(config.selectable){