Skip to content

Commit

Permalink
tweaking the window
Browse files Browse the repository at this point in the history
Waiting for someone who is good at this to fix it.

Signed-off-by: Ronald G. Minnich <[email protected]>
  • Loading branch information
rminnich committed Sep 17, 2024
1 parent e8b9506 commit e49e2ff
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions pkg/visitors/display.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func (v *Display) Visit(f uefi.Firmware) error {
wid := 256*squareSize
ht := squareSize*(numblocks/256)
// Initialize the draw context with a dynamically-sized window
d, err := draw.Init(nil, "", v.Name, fmt.Sprintf("%dx%d", wid+50, ht+20))
d, err := draw.Init(nil, "", v.Name, fmt.Sprintf("%dx%d", wid+100, ht+20))
if err != nil {
return fmt.Errorf("failed to initialize draw: %w", err)
}
Expand All @@ -74,18 +74,14 @@ func (v *Display) Visit(f uefi.Firmware) error {
//log.Fatalf("failed to initialize mouse: %v", err)
//}

// Determine the window size from the screen image
winWidth := wid
winHeight := ht

// Get color images for red and green
grn := d.AllocImageMix(draw.Green, draw.Opaque)
red := d.AllocImageMix(draw.Red, draw.Opaque)

var buf [uefi.RegionBlockSize]byte
done:
for y := 0; y < winHeight; y++ {
for x := 0; x < winWidth; x++ {
for y := 0; y < ht; y++ {
for x := 0; x < wid; x++ {
// Calculate the top-left corner of the square
pt := draw.Pt(20+x*squareSize, 20+y*squareSize)
rect := draw.Rect(pt.X, pt.Y, pt.X+squareSize, pt.Y+squareSize)
Expand Down

0 comments on commit e49e2ff

Please sign in to comment.