1
0
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:
Alexander Medvednikov
2022-12-21 19:33:19 +03:00
parent ccbb8ab0ca
commit 88e33a83de
7 changed files with 128 additions and 24 deletions

View File

@@ -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)
}

View File

@@ -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() {