Skip to content

[osx] Fix scaling issues when painting dirty areas #141

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion os/skia/skia_window_osx.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class SkiaWindowOSX : public SkiaWindowBase<WindowOSX> {
void onChangeBackingProperties() override;

private:
void paintGC(const gfx::Rect& rect);
void paintGC(const gfx::RectF& rect);

bool m_closing = false;

Expand Down
6 changes: 3 additions & 3 deletions os/skia/skia_window_osx.mm
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@
setColorSpace(colorSpace());
}

void SkiaWindowOSX::paintGC(const gfx::Rect& rect)
void SkiaWindowOSX::paintGC(const gfx::RectF& rect)
{
if (!this->isInitialized())
return;
Expand All @@ -201,7 +201,7 @@
return;

NSRect viewBounds = m_nsWindow.contentView.bounds;
int scale = this->scale();
float scale = this->scale();

SkiaSurface* surface = static_cast<SkiaSurface*>(this->surface());
if (!surface->isValid())
Expand All @@ -211,7 +211,7 @@
const SkBitmap& origBitmap = surface->bitmap();

SkBitmap bitmap;
if (scale == 1) {
if (scale == 1.0f) {
// Create a subset to draw on the view
if (!origBitmap.extractSubset(
&bitmap,
Expand Down