@@ -167,31 +167,33 @@ void FlutterTizenView::OnResize(int32_t left,
167167}
168168
169169void FlutterTizenView::OnRotate (int32_t degree) {
170- rotation_degree_ = degree;
171- // Compute renderer transformation based on the angle of rotation.
172- double rad = (360 - rotation_degree_) * M_PI / 180 ;
173170 TizenGeometry geometry = tizen_view_->GetGeometry ();
174171 int32_t width = geometry.width ;
175172 int32_t height = geometry.height ;
176173
177- double trans_x = 0.0 , trans_y = 0.0 ;
178- if (rotation_degree_ == 90 ) {
179- trans_y = height;
180- } else if (rotation_degree_ == 180 ) {
181- trans_x = width;
182- trans_y = height;
183- } else if (rotation_degree_ == 270 ) {
184- trans_x = width;
185- }
174+ if (engine_->renderer ()->type () == FlutterDesktopRendererType::kEGL ) {
175+ rotation_degree_ = degree;
176+ // Compute renderer transformation based on the angle of rotation.
177+ double rad = (360 - rotation_degree_) * M_PI / 180 ;
178+ double trans_x = 0.0 , trans_y = 0.0 ;
179+ if (rotation_degree_ == 90 ) {
180+ trans_y = height;
181+ } else if (rotation_degree_ == 180 ) {
182+ trans_x = width;
183+ trans_y = height;
184+ } else if (rotation_degree_ == 270 ) {
185+ trans_x = width;
186+ }
186187
187- flutter_transformation_ = {
188- cos (rad), -sin (rad), trans_x, // x
189- sin (rad), cos (rad), trans_y, // y
190- 0.0 , 0.0 , 1.0 // perspective
191- };
188+ flutter_transformation_ = {
189+ cos (rad), -sin (rad), trans_x, // x
190+ sin (rad), cos (rad), trans_y, // y
191+ 0.0 , 0.0 , 1.0 // perspective
192+ };
192193
193- if (rotation_degree_ == 90 || rotation_degree_ == 270 ) {
194- std::swap (width, height);
194+ if (rotation_degree_ == 90 || rotation_degree_ == 270 ) {
195+ std::swap (width, height);
196+ }
195197 }
196198
197199 engine_->renderer ()->ResizeSurface (width, height);
0 commit comments