extend setSheetOffset to accept an optional 2nd offset

This commit is contained in:
leethomas 2016-05-19 20:19:08 -07:00
parent eaacbc86c7
commit 7d93642f42
4 changed files with 7 additions and 16 deletions

View file

@ -371,12 +371,10 @@ std::vector<int> Window::GetMaximumSize() {
return result;
}
void Window::SetSheetOffset(double offsetY) {
window_->SetSheetOffset(offsetY);
}
void Window::SetSheetOffsets(double offsetX, double offsetY) {
window_->SetSheetOffsets(offsetX, offsetY);
void Window::SetSheetOffset(double offsetY, mate::Arguments* args) {
double offsetX = 0.0;
args->GetNext(&offsetX);
window_->SetSheetOffset(offsetX, offsetY);
}
void Window::SetResizable(bool resizable) {
@ -686,7 +684,6 @@ void Window::BuildPrototype(v8::Isolate* isolate,
.SetMethod("setMaximumSize", &Window::SetMaximumSize)
.SetMethod("getMaximumSize", &Window::GetMaximumSize)
.SetMethod("setSheetOffset", &Window::SetSheetOffset)
.SetMethod("setSheetOffsets", &Window::SetSheetOffsets)
.SetMethod("setResizable", &Window::SetResizable)
.SetMethod("isResizable", &Window::IsResizable)
.SetMethod("setMovable", &Window::SetMovable)

View file

@ -110,8 +110,7 @@ class Window : public mate::TrackableObject<Window>,
std::vector<int> GetMinimumSize();
void SetMaximumSize(int width, int height);
std::vector<int> GetMaximumSize();
void SetSheetOffset(double offsetY);
void SetSheetOffsets(double offsetX, double offsetY);
void SetSheetOffset(double offsetY, mate::Arguments* args);
void SetResizable(bool resizable);
bool IsResizable();
void SetMovable(bool movable);

View file

@ -255,11 +255,7 @@ gfx::Size NativeWindow::GetMaximumSize() {
return GetSizeConstraints().GetMaximumSize();
}
void NativeWindow::SetSheetOffset(const double offsetY) {
sheet_offset_y_ = offsetY;
}
void NativeWindow::SetSheetOffsets(const double offsetX, const double offsetY) {
void NativeWindow::SetSheetOffset(const double offsetX, const double offsetY) {
sheet_offset_x_ = offsetX;
sheet_offset_y_ = offsetY;
}

View file

@ -123,8 +123,7 @@ class NativeWindow : public base::SupportsUserData,
virtual gfx::Size GetMinimumSize();
virtual void SetMaximumSize(const gfx::Size& size);
virtual gfx::Size GetMaximumSize();
virtual void SetSheetOffset(const double offsetY);
virtual void SetSheetOffsets(const double offsetX, const double offsetY);
virtual void SetSheetOffset(const double offsetX, const double offsetY);
virtual double GetSheetOffsetX();
virtual double GetSheetOffsetY();
virtual void SetResizable(bool resizable) = 0;