Skip to content

Commit

Permalink
Override Offset
Browse files Browse the repository at this point in the history
  • Loading branch information
Swanseo0 committed Nov 16, 2023
1 parent b334fd5 commit 870d7dd
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
16 changes: 14 additions & 2 deletions packages/webview_flutter/tizen/src/webview.cc
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,14 @@ void WebView::Dispose() {
}
}

void WebView::Offset(double left, double top) {
left_ = left;
top_ = top;

evas_object_move(webview_instance_, static_cast<int>(left_),
static_cast<int>(top_));
}

void WebView::Resize(double width, double height) {
width_ = width;
height_ = height;
Expand Down Expand Up @@ -232,8 +240,8 @@ void WebView::Touch(int type, int button, double x, double y, double dx,
Eina_List* points = 0;
Ewk_Touch_Point* point = new Ewk_Touch_Point;
point->id = 0;
point->x = x;
point->y = y;
point->x = x + left_;
point->y = y + top_;
point->state = state;
points = eina_list_append(points, point);

Expand Down Expand Up @@ -314,6 +322,10 @@ void WebView::InitWebView() {
EwkInternalApiBinding::GetInstance().view.KeyEventsEnabledSet(
webview_instance_, true);

#ifdef TV_PROFILE
EwkInternalApiBinding::GetInstance().view.SupportVideoHoleSet(webview_instance_, window_, true, false);
#endif

evas_object_smart_callback_add(webview_instance_, "offscreen,frame,rendered",
&WebView::OnFrameRendered, this);
evas_object_smart_callback_add(webview_instance_, "load,started",
Expand Down
3 changes: 3 additions & 0 deletions packages/webview_flutter/tizen/src/webview.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class WebView : public PlatformView {

virtual void Dispose() override;

virtual void Offset(double left, double top) override;
virtual void Resize(double width, double height) override;
virtual void Touch(int type, int button, double x, double y, double dx,
double dy) override;
Expand Down Expand Up @@ -85,6 +86,8 @@ class WebView : public PlatformView {
flutter::TextureRegistrar* texture_registrar_;
double width_ = 0.0;
double height_ = 0.0;
double left_ = 0.0;
double top_ = 0.0;
void* window_ = nullptr;
BufferUnit* working_surface_ = nullptr;
BufferUnit* candidate_surface_ = nullptr;
Expand Down

0 comments on commit 870d7dd

Please sign in to comment.