diff options
author | Andreas Kling <kling@serenityos.org> | 2020-04-08 11:22:40 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-04-08 17:19:46 +0200 |
commit | 348e209eb527d94da5bd51d5660d9f662c952a54 (patch) | |
tree | c6674b8c42948dfd0e2621ecd6d6245b784d212d /Libraries/LibWeb/Bindings | |
parent | 2ffa054574839b7f1e2c44e8a26e62b0d632d01e (diff) | |
download | serenity-348e209eb527d94da5bd51d5660d9f662c952a54.zip |
LibWeb: Make CanvasRenderingContext2D use floats instead of ints
This matches what we already do for the layout tree and things are
expected to work this way regardless.
Diffstat (limited to 'Libraries/LibWeb/Bindings')
-rw-r--r-- | Libraries/LibWeb/Bindings/CanvasRenderingContext2DWrapper.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Libraries/LibWeb/Bindings/CanvasRenderingContext2DWrapper.cpp b/Libraries/LibWeb/Bindings/CanvasRenderingContext2DWrapper.cpp index 37ba819612..63eb9bc9c2 100644 --- a/Libraries/LibWeb/Bindings/CanvasRenderingContext2DWrapper.cpp +++ b/Libraries/LibWeb/Bindings/CanvasRenderingContext2DWrapper.cpp @@ -71,7 +71,7 @@ JS::Value CanvasRenderingContext2DWrapper::fill_rect(JS::Interpreter& interprete return {}; auto& arguments = interpreter.call_frame().arguments; if (arguments.size() >= 4) - impl->fill_rect(arguments[0].to_i32(), arguments[1].to_i32(), arguments[2].to_i32(), arguments[3].to_i32()); + impl->fill_rect(arguments[0].to_double(), arguments[1].to_double(), arguments[2].to_double(), arguments[3].to_double()); return JS::js_undefined(); } @@ -82,7 +82,7 @@ JS::Value CanvasRenderingContext2DWrapper::stroke_rect(JS::Interpreter& interpre return {}; auto& arguments = interpreter.call_frame().arguments; if (arguments.size() >= 4) - impl->stroke_rect(arguments[0].to_i32(), arguments[1].to_i32(), arguments[2].to_i32(), arguments[3].to_i32()); + impl->stroke_rect(arguments[0].to_double(), arguments[1].to_double(), arguments[2].to_double(), arguments[3].to_double()); return JS::js_undefined(); } @@ -93,7 +93,7 @@ JS::Value CanvasRenderingContext2DWrapper::scale(JS::Interpreter& interpreter) return {}; auto& arguments = interpreter.call_frame().arguments; if (arguments.size() >= 2) - impl->scale(arguments[0].to_number().as_double(), arguments[1].to_number().as_double()); + impl->scale(arguments[0].to_double(), arguments[1].to_double()); return JS::js_undefined(); } @@ -104,7 +104,7 @@ JS::Value CanvasRenderingContext2DWrapper::translate(JS::Interpreter& interprete return {}; auto& arguments = interpreter.call_frame().arguments; if (arguments.size() >= 2) - impl->translate(arguments[0].to_number().as_double(), arguments[1].to_number().as_double()); + impl->translate(arguments[0].to_double(), arguments[1].to_double()); return JS::js_undefined(); } |