Skip to content

Commit

Permalink
Remove unnecessary changes
Browse files Browse the repository at this point in the history
  • Loading branch information
x3ro committed Jun 26, 2022
1 parent d500337 commit c89127b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
5 changes: 2 additions & 3 deletions piet-direct2d/src/d2d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,6 @@ impl DeviceContext {
width: usize,
height: usize,
alpha_mode: D2D1_ALPHA_MODE,
dpi_scale: f32,
) -> Result<Bitmap, Error> {
// Maybe using TryInto would be more Rust-like.
// Note: value is set so that multiplying by 4 (for pitch) is valid.
Expand All @@ -801,8 +800,8 @@ impl DeviceContext {
};
let props = D2D1_BITMAP_PROPERTIES1 {
pixelFormat: format,
dpiX: 96.0 * dpi_scale,
dpiY: 96.0 * dpi_scale,
dpiX: 96.,
dpiY: 96.0,
bitmapOptions: D2D1_BITMAP_OPTIONS_NONE,
colorContext: null_mut(),
};
Expand Down
4 changes: 0 additions & 4 deletions piet-direct2d/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -481,10 +481,6 @@ impl<'a> RenderContext for D2DRenderContext<'a> {
device_size.x as usize,
device_size.y as usize,
D2D1_ALPHA_MODE_PREMULTIPLIED,
// Here we force a 1.0 dpi scale, because we're already doing all of
// the dpi calculations manually. For some reason I can't get this part
// to work if I pass the dpi scale of render context bitmap.
1.0,
)?;

let src_rect = Rect {
Expand Down

0 comments on commit c89127b

Please sign in to comment.