• 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/gui/TriImageTooltip.scala
1
package tripaint.view.gui
2

3
import tripaint.model.coords.StorageCoords
4
import tripaint.model.image.{GridCell, ImagePool, ImageStorage}
5

6
import scalafx.scene.control.Tooltip
7

8
object TriImageTooltip {
UNCOV
9
  def fromImagePool(
×
10
      content: GridCell,
11
      locationOfImage: ImageStorage => Option[ImagePool.SaveLocation]
12
  ): Tooltip = {
UNCOV
13
    val getText = () => makeText(content.storage.imageSize, locationOfImage(content.storage))
×
14

15
    val tooltip = new Tooltip()
×
16
    tooltip.text = getText()
×
UNCOV
17
    tooltip.activated.onChange(tooltip.text = getText())
×
18

19
    tooltip
20
  }
21

UNCOV
22
  private def makeText(imageSize: Int, saveLocation: Option[ImagePool.SaveLocation]) = {
×
23
    val startText = saveLocation match {
24
      case Some(location) =>
UNCOV
25
        val fileName = location.file.getName
×
26

27
        val hasOffset = location.offset != StorageCoords(0, 0)
UNCOV
28
        val offsetText = if hasOffset then s"\nOffset: ${location.offset}" else ""
×
29

30
        s"File: $fileName" + offsetText
×
UNCOV
31
      case None =>
×
32
        "Not saved"
33
    }
34

UNCOV
35
    s"$startText\nSize: $imageSize"
×
36
  }
37
}
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