mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-01-30 10:25:01 +01:00
fix some rounding errors at the weekly view grid
This commit is contained in:
parent
c953044cde
commit
c1a7e838cd
@ -20,13 +20,13 @@ class WeeklyViewGrid(context: Context, attrs: AttributeSet, defStyle: Int) : Vie
|
|||||||
|
|
||||||
override fun onDraw(canvas: Canvas) {
|
override fun onDraw(canvas: Canvas) {
|
||||||
super.onDraw(canvas)
|
super.onDraw(canvas)
|
||||||
val rowHeight = height / ROWS_CNT
|
val rowHeight = height / ROWS_CNT.toFloat()
|
||||||
for (i in 0 until ROWS_CNT) {
|
for (i in 0 until ROWS_CNT) {
|
||||||
val y = rowHeight * i.toFloat()
|
val y = rowHeight * i.toFloat()
|
||||||
canvas.drawLine(0f, y, width.toFloat(), y, paint)
|
canvas.drawLine(0f, y, width.toFloat(), y, paint)
|
||||||
}
|
}
|
||||||
|
|
||||||
val rowWidth = width / COLS_CNT
|
val rowWidth = width / COLS_CNT.toFloat()
|
||||||
for (i in 0 until COLS_CNT) {
|
for (i in 0 until COLS_CNT) {
|
||||||
val x = rowWidth * i.toFloat()
|
val x = rowWidth * i.toFloat()
|
||||||
canvas.drawLine(x, 0f, x, height.toFloat(), paint)
|
canvas.drawLine(x, 0f, x, height.toFloat(), paint)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user