Skip to content

Commit

Permalink
No need for extra variable for target width/height.
Browse files Browse the repository at this point in the history
  • Loading branch information
hzeller committed Jan 25, 2024
1 parent de6d52b commit 908e2ef
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/pdf-image-source.cc
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,10 @@ bool PDFImageSource::LoadAndScale(const DisplayOptions &opts, int frame_offset,
.x1 = 0, .y1 = 0, .x2 = orig_width_, .y2 = orig_height_};
}

int target_width;
int target_height;
int render_width;
int render_height;
CalcScaleToFitDisplay(orig_width_, orig_height_, opts, false,
&target_width, &target_height);

int render_width = target_width;
int render_height = target_height;
&render_width, &render_height);

const auto kCairoFormat = CAIRO_FORMAT_ARGB32;
int stride = cairo_format_stride_for_width(kCairoFormat, render_width);
Expand Down

0 comments on commit 908e2ef

Please sign in to comment.