Skip to content

Commit

Permalink
Avoid inserting grouping commas into large numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
jzbrooks committed Sep 16, 2024
1 parent 62e2bfd commit 5bd121c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class ScalableVectorGraphicCommandPrinter(private val decimalDigits: Int) : Comm
DecimalFormat().apply {
maximumFractionDigits = decimalDigits
isDecimalSeparatorAlwaysShown = false
isGroupingUsed = false
roundingMode = RoundingMode.HALF_UP
minimumIntegerDigits = 0
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class VectorDrawableCommandPrinter(private val decimalDigits: Int) : CommandPrin
DecimalFormat().apply {
maximumFractionDigits = decimalDigits
isDecimalSeparatorAlwaysShown = false
isGroupingUsed = false
roundingMode = RoundingMode.HALF_UP
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import com.jzbrooks.vgo.core.optimization.BakeTransformations
import com.jzbrooks.vgo.core.optimization.BreakoutImplicitCommands
import com.jzbrooks.vgo.core.optimization.CollapseGroups
import com.jzbrooks.vgo.core.optimization.CommandVariant
import com.jzbrooks.vgo.core.optimization.ConvertCurvesToArcs
import com.jzbrooks.vgo.core.optimization.MergePaths
import com.jzbrooks.vgo.core.optimization.OptimizationRegistry
import com.jzbrooks.vgo.core.optimization.Polycommands
Expand All @@ -29,7 +30,7 @@ class VectorDrawableOptimizationRegistry : OptimizationRegistry(BOTTOM_UP, TOP_D
BreakoutImplicitCommands(),
CommandVariant(CommandVariant.Mode.Relative),
SimplifyLineCommands(1e-3f),
// ConvertCurvesToArcs(VectorDrawableCommandPrinter(3)),
ConvertCurvesToArcs(VectorDrawableCommandPrinter(3)),
SimplifyBezierCurveCommands(1e-3f),
RemoveRedundantCommands(),
CommandVariant(CommandVariant.Mode.Compact(VectorDrawableCommandPrinter(3))),
Expand Down

0 comments on commit 5bd121c

Please sign in to comment.