-
-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable with build tag nucular_gio
- Loading branch information
Showing
27 changed files
with
1,826 additions
and
1,043 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// +build nucular_gio | ||
|
||
package command | ||
|
||
import ( | ||
"image" | ||
|
||
"gioui.org/op/paint" | ||
"github.com/aarzilli/nucular/rect" | ||
) | ||
|
||
type Image struct { | ||
Img paint.ImageOp | ||
} | ||
|
||
func (b *Buffer) DrawImage(r rect.Rect, img *image.RGBA) { | ||
if !r.Intersect(&b.Clip) { | ||
return | ||
} | ||
|
||
var cmd Command | ||
cmd.Kind = ImageCmd | ||
cmd.Rect = r | ||
cmd.Image.Img = paint.NewImageOp(img) | ||
b.Commands = append(b.Commands, cmd) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// +build !nucular_gio | ||
|
||
package command | ||
|
||
import ( | ||
"github.com/aarzilli/nucular/rect" | ||
"image" | ||
) | ||
|
||
type Image struct { | ||
Img *image.RGBA | ||
} | ||
|
||
func (b *Buffer) DrawImage(r rect.Rect, img *image.RGBA) { | ||
if !r.Intersect(&b.Clip) { | ||
return | ||
} | ||
|
||
var cmd Command | ||
cmd.Kind = ImageCmd | ||
cmd.Rect = r | ||
cmd.Image.Img = img | ||
b.Commands = append(b.Commands, cmd) | ||
} |
Oops, something went wrong.