mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 04:27:44 +00:00
LibWeb: Forward CanvasRenderingContext.strokeText() to fillText()
This is a hack until we get an actual text stroking implementation.
This commit is contained in:
parent
dc3bf32307
commit
926d5271b4
3 changed files with 8 additions and 0 deletions
|
@ -164,6 +164,12 @@ void CanvasRenderingContext2D::fill_text(const String& text, float x, float y, O
|
||||||
did_draw(transformed_rect.to_type<float>());
|
did_draw(transformed_rect.to_type<float>());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CanvasRenderingContext2D::stroke_text(String const& text, float x, float y, Optional<double> max_width)
|
||||||
|
{
|
||||||
|
// FIXME: Stroke the text instead of filling it.
|
||||||
|
fill_text(text, x, y, max_width);
|
||||||
|
}
|
||||||
|
|
||||||
void CanvasRenderingContext2D::begin_path()
|
void CanvasRenderingContext2D::begin_path()
|
||||||
{
|
{
|
||||||
m_path = Gfx::Path();
|
m_path = Gfx::Path();
|
||||||
|
|
|
@ -65,6 +65,7 @@ public:
|
||||||
void stroke();
|
void stroke();
|
||||||
|
|
||||||
void fill_text(const String&, float x, float y, Optional<double> max_width);
|
void fill_text(const String&, float x, float y, Optional<double> max_width);
|
||||||
|
void stroke_text(String const&, float x, float y, Optional<double> max_width);
|
||||||
|
|
||||||
// FIXME: We should only have one fill(), really. Fix the wrapper generator!
|
// FIXME: We should only have one fill(), really. Fix the wrapper generator!
|
||||||
void fill(Gfx::Painter::WindingRule);
|
void fill(Gfx::Painter::WindingRule);
|
||||||
|
|
|
@ -22,6 +22,7 @@ interface CanvasRenderingContext2D {
|
||||||
undefined rect(double x, double y, double width, double height);
|
undefined rect(double x, double y, double width, double height);
|
||||||
|
|
||||||
undefined fillText(DOMString text, double x, double y, optional double maxWidth);
|
undefined fillText(DOMString text, double x, double y, optional double maxWidth);
|
||||||
|
undefined strokeText(DOMString text, double x, double y, optional double maxWidth);
|
||||||
|
|
||||||
undefined drawImage(HTMLImageElement image, double dx, double dy);
|
undefined drawImage(HTMLImageElement image, double dx, double dy);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue