Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit53c8fa5

Browse files
committed
more changes to image backend
1 parentc0db71d commit53c8fa5

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

‎src/draw_image.rs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,20 @@ pub struct DrawImage {
88
realspace:Range2d,
99
color:[u8;4],
1010
}
11-
#![allow(dead_code)]
12-
#![allow(unused_variables)]
1311

1412
implDrawImage{
15-
pubfnnew(sdlh:Sdl2Mt) ->Box<DrawSDL>{
16-
let window_id = sdlh.create_simple_window("2D plot",720,720).unwrap();
17-
13+
pubfnnew() ->Box<DrawImage>{
1814
let default_s =Range{min:0.0,max:0.0};
1915

2016
let default_r =Range{
2117
min:0.0,
2218
max:720.0,
2319
};
2420

25-
Box::new(DrawSDL{
26-
sdlh,
27-
window_id,
21+
Box::new(DrawImage{
2822
screenspace:Range2d(default_s, default_s),
2923
realspace:Range2d(default_r, default_r),
30-
color:pixels::Color::RGBA(0,0,0,255),
24+
color:[0,0,0,255],
3125
})
3226
}
3327
}
@@ -45,7 +39,7 @@ impl Drawable for DrawImage {
4539

4640
/// Set color for various drawing actions
4741
fnset_color(&mutself,color:[u8;4]){
48-
self.color =pixels::Color::RGBA(color[0], color[1], color[2], color[3]);
42+
self.color = color;
4943
}
5044

5145
/// Clears the output surface

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp