fix: hyphenated slug would not contract

This commit is contained in:
minjaesong
2024-04-28 17:33:37 +09:00
parent 631e60bb73
commit 869d424292
2 changed files with 3 additions and 4 deletions

View File

@@ -332,7 +332,7 @@ class FlippingSpriteBatch(size: Int = 1000) : SpriteBatch(size) {
} }
lateinit var appConfig: Lwjgl3ApplicationConfiguration lateinit var appConfig: Lwjgl3ApplicationConfiguration
const val TEXW = 800 const val TEXW = 480 + 48
const val TEXH = 24 * 170 const val TEXH = 24 * 170
const val WIDTH = TEXW const val WIDTH = TEXW

View File

@@ -199,7 +199,7 @@ class MovableType(
} }
} }
moveSlugsToFitTheWidth(operation, slug, selectedWidthDelta) moveSlugsToFitTheWidth(operation, slug, selectedWidthDelta.absoluteValue)
// put the trailing word back into the upcoming words // put the trailing word back into the upcoming words
if (selectedStrat == "Widen") { if (selectedStrat == "Widen") {
@@ -223,7 +223,7 @@ class MovableType(
// insert hyphHead into the slug // insert hyphHead into the slug
addToSlug(hyphHead) addToSlug(hyphHead)
moveSlugsToFitTheWidth(operation, slug, selectedWidthDelta) moveSlugsToFitTheWidth(operation, slug, selectedWidthDelta.absoluteValue)
// put the tail into the upcoming words // put the tail into the upcoming words
addHyphenatedTail(hyphTail) addHyphenatedTail(hyphTail)
@@ -312,7 +312,6 @@ class MovableType(
private val commas = listOf(0x2C, 0x3B, 0x3001, 0xff0c).toSortedSet() private val commas = listOf(0x2C, 0x3B, 0x3001, 0xff0c).toSortedSet()
private val hangable = listOf(0x2E, 0x2C, 0x3A, 0x3B).toSortedSet() private val hangable = listOf(0x2E, 0x2C, 0x3A, 0x3B).toSortedSet()
private val hangableFW = listOf(0x3001, 0x3002, 0xff0c, 0xff0e).toSortedSet() private val hangableFW = listOf(0x3001, 0x3002, 0xff0c, 0xff0e).toSortedSet()
private const val spaceWidth = 5
private const val hangWidth = 6 private const val hangWidth = 6
private const val hangWidthFW = 16 private const val hangWidthFW = 16