mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
gg: fix draw_image on macos native; vcreate: vweb template
This commit is contained in:
@@ -12,7 +12,7 @@ const (
|
||||
struct App {
|
||||
mut:
|
||||
gg &gg.Context = unsafe { nil }
|
||||
image gg.Image
|
||||
image int // gg.Image
|
||||
}
|
||||
|
||||
fn main() {
|
||||
@@ -30,7 +30,7 @@ fn main() {
|
||||
init_fn: init_images
|
||||
)
|
||||
mut logo_path := os.resource_abs_path(os.join_path('..', 'assets', 'logo.png'))
|
||||
app.image = app.gg.create_image(logo_path)
|
||||
app.image = app.gg.create_image(logo_path).id
|
||||
app.gg.run()
|
||||
}
|
||||
|
||||
@@ -49,5 +49,5 @@ fn (app &App) draw() {
|
||||
// app.gg.draw_text_def(300,300, 'привет')
|
||||
app.gg.draw_rect_filled(10, 10, 100, 30, gx.blue)
|
||||
app.gg.draw_rect_empty(110, 150, 80, 40, gx.black)
|
||||
app.gg.draw_image(230, 30, app.image.width, app.image.height, app.image)
|
||||
app.gg.draw_image_by_id(230, 30, 50, 50, app.image)
|
||||
}
|
||||
|
@@ -19,7 +19,7 @@ mut:
|
||||
}
|
||||
|
||||
pub fn (app App) before_request() {
|
||||
println('[Vweb] ${app.Context.req.method} ${app.Context.req.url}')
|
||||
println('[vweb] before_request: ${app.req.method} ${app.req.url}')
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
Reference in New Issue
Block a user