• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Martomate / TriPaint / 9275511596

28 May 2024 07:51PM UTC coverage: 29.682% (+1.8%) from 27.877%
9275511596

push

github

Martomate
Updated to Scala 3.4 and MUnit 1.0

2 of 11 new or added lines in 9 files covered. (18.18%)

430 existing lines in 38 files now uncovered.

401 of 1351 relevant lines covered (29.68%)

0.3 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/main/scala/tripaint/view/image/TriangleCoordsToReal.scala
1
package tripaint.view.image
2

3
import tripaint.model.coords.TriangleCoords
4

5
class TriangleCoordsToReal(imageSize: Int, normToReal: (Double, Double) => (Double, Double)) {
6
  private val xs: Array[Double] = new Array(3)
×
UNCOV
7
  private val ys: Array[Double] = new Array(3)
×
8

UNCOV
9
  def triangleCornerPoints(coords: TriangleCoords): (Array[Double], Array[Double]) = {
×
10
    val yp = coords.y
11
    val xp = coords.x * 0.5 - (yp - imageSize + 1) * 0.5
UNCOV
12
    storeAllCoords(xp, yp, coords.x % 2 == 1)
×
13
    (xs, ys)
14
  }
15

16
  private def storeAllCoords(xp: Double, yp: Double, upsideDown: Boolean): Unit = {
×
17
    if upsideDown then {
×
18
      storeCoords(0, xp, yp)
×
19
      storeCoords(1, xp + 1.0, yp)
×
20
      storeCoords(2, xp + 0.5, yp + 1.0)
×
21
    } else {
×
22
      storeCoords(0, xp, yp + 1.0)
×
23
      storeCoords(1, xp + 1.0, yp + 1.0)
×
UNCOV
24
      storeCoords(2, xp + 0.5, yp)
×
25
    }
26
  }
27

28
  private def storeCoords(index: Int, xPos: Double, yPos: Double): Unit = {
×
29
    val (rx, ry) = normToReal(xPos / imageSize, yPos / imageSize)
×
30
    xs(index) = rx
×
UNCOV
31
    ys(index) = ry
×
32
  }
33
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc