mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Stocks FAB "+" sometimes teleports to near the top left
The matrix argument to drawPicture doesn't seem to do what we want exactly. Instead, use the normal matrix in the canvas. Also, handle cull rects with non-zero left and top coordinates. Fixes #1229
This commit is contained in:
parent
4742f4ef6a
commit
6bb4c2374e
@ -84,8 +84,9 @@ skia::RefPtr<SkImage> RasterCache::GetPrerolledImage(GrContext* context,
|
||||
if (surface) {
|
||||
SkCanvas* canvas = surface->getCanvas();
|
||||
canvas->clear(SK_ColorTRANSPARENT);
|
||||
SkMatrix matrix = SkMatrix::MakeScale(scaleX, scaleY);
|
||||
canvas->drawPicture(picture, &matrix, nullptr);
|
||||
canvas->translate(-rect.left(), -rect.right());
|
||||
canvas->scale(scaleX, scaleY);
|
||||
canvas->drawPicture(picture);
|
||||
entry.image = skia::AdoptRef(surface->newImageSnapshot());
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user