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

mlange-42 / arche-pixel / 6787797515

07 Nov 2023 04:59PM CUT coverage: 83.59%. First build
6787797515

push

github

web-flow
CI tests, 2nd attempt (#45)

* Destroy window on UI finalization
* Enable full tests with window creation using `xvfb`
* Add coverage report and badge

Commits:
* run tests with xvfb
* destroy the window on finalization
* add TestMain to run all tests on the main thread
* enable window creation in all tests
* add coveralls step to CI tests
* add coveralls badge, update changelog

3 of 3 new or added lines in 1 file covered. (100.0%)

1355 of 1621 relevant lines covered (83.59%)

164130.5 hits per line

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

0.0
/window/util.go
1
package window
2

3
import (
4
        "math"
5

6
        "github.com/gopxl/pixel/v2/backends/opengl"
7
)
8

9
// Scale calculates the drawing scale for fitting a source region into a window's canvas.
10
func Scale(win *opengl.Window, srcWidth, srcHeight float64) float64 {
×
11
        winWidth, winHeight := win.Canvas().Bounds().W(), win.Canvas().Bounds().H()
×
12
        scX, scY := winWidth/float64(srcWidth), winHeight/float64(srcHeight)
×
13
        return math.Min(scX, scY)
×
14
}
×
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