Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make line width equal to point's stroke width #798

Merged
merged 9 commits into from
Jun 28, 2023
Prev Previous commit
Next Next commit
Add fixed colors structure.
  • Loading branch information
OLarionova-HORIS committed Jun 26, 2023
commit 911118e6263df4ddabd2ebc00ff0f2d3110c22f7
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,21 @@ internal class DefaultGeomTheme private constructor(
}
}

private class FixedColors(geomKind: GeomKind) {
val color = if (geomKind == GeomKind.SMOOTH) {
Color.MAGENTA
} else {
Color.PACIFIC_BLUE
}
val fill = Color.PACIFIC_BLUE
}

// defaults for geomKind
fun forGeomKind(geomKind: GeomKind, inheritedColors: InheritedColors): GeomTheme {
var color = Color.PACIFIC_BLUE
var fill = Color.PACIFIC_BLUE
val fixedColors = FixedColors(geomKind)

var color = fixedColors.color
var fill = fixedColors.fill
var alpha = 1.0
var size = 0.5
var lineWidth = 0.5
Expand Down Expand Up @@ -123,7 +134,6 @@ internal class DefaultGeomTheme private constructor(
}

GeomKind.SMOOTH -> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is bad: alpha = 1.5


                GeomKind.SMOOTH -> {
                    color = Color.MAGENTA

We don't want to use constant values no longer. Should be a field in BASE (but still get rid of the BASE).

color = Color.MAGENTA
fill = inheritedColors.lineColor()
alpha = 0.15
}
Expand Down