Skip to content

Commit

Permalink
swrenderer: More fix to the screen rotation for line by line
Browse files Browse the repository at this point in the history
  • Loading branch information
ogoffart committed Dec 8, 2023
1 parent 0c8a48e commit f25a419
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/core/software_renderer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -683,13 +683,13 @@ fn render_window_frame_by_line(
let dirty_region = scene.dirty_region;
let to_draw_tr = dirty_region.transformed(rotation);

debug_assert!(scene.current_line >= dirty_region.origin.y_length());
scene.current_line = to_draw_tr.origin.y_length();

let mut background_color = TargetPixel::background();
// FIXME gradient
TargetPixel::blend(&mut background_color, background.color().into());

while scene.current_line < dirty_region.origin.y_length() + dirty_region.size.height_length() {
while scene.current_line < to_draw_tr.origin.y_length() + to_draw_tr.size.height_length() {
line_buffer.process_line(
scene.current_line.get() as usize,
to_draw_tr.min_x() as usize..to_draw_tr.max_x() as usize,
Expand Down Expand Up @@ -768,7 +768,7 @@ fn render_window_frame_by_line(
},
);

if scene.current_line < dirty_region.origin.y_length() + dirty_region.size.height_length() {
if scene.current_line < to_draw_tr.origin.y_length() + to_draw_tr.size.height_length() {
scene.next_line();
}
}
Expand Down

0 comments on commit f25a419

Please sign in to comment.