Skip to content

Commit

Permalink
review comments followup
Browse files Browse the repository at this point in the history
  • Loading branch information
Amir Hardon committed Oct 26, 2018
1 parent b3edacd commit 663c259
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion flow/embedded_views.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace flow {

class EmbeddedViewParams {
public:
SkPoint translatePixels;
SkPoint offsetPixels;
SkSize sizePoints;
};

Expand Down
2 changes: 1 addition & 1 deletion flow/layers/platform_view_layer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ void PlatformViewLayer::Paint(PaintContext& context) const {
}
EmbeddedViewParams params;
SkMatrix transform = context.canvas.getTotalMatrix();
params.translatePixels = SkPoint::Make(transform.getTranslateX(), transform.getTranslateY());
params.offsetPixels = SkPoint::Make(transform.getTranslateX(), transform.getTranslateY());
params.sizePoints = size_;

context.view_embedder->CompositeEmbeddedView(view_id_, params);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,11 @@

void FlutterPlatformViewsController::CompositeEmbeddedView(int view_id,
const flow::EmbeddedViewParams& params) {
// TODO(amirh): assert that this is running on the platform thread once we support the iOS
// embedded views thread configuration.
CGFloat screenScale = [[UIScreen mainScreen] scale];
CGRect rect =
CGRectMake(params.translatePixels.x() / screenScale, params.translatePixels.y() / screenScale,
CGRectMake(params.offsetPixels.x() / screenScale, params.offsetPixels.y() / screenScale,
params.sizePoints.width(), params.sizePoints.height());

UIView* view = views_[view_id];
Expand Down

0 comments on commit 663c259

Please sign in to comment.