Change DrawString() and add StrokeLine() to reveal wrong pen-position

Change-Id: Iec584657741f2bb682bff557dcd3b733a9166c7c
Reviewed-on: https://review.haiku-os.org/815
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This commit is contained in:
Stephan Aßmus 2019-01-02 18:36:49 +01:00 committed by waddlesplash
parent 1876ba00cd
commit f10faf61ac

View File

@ -12,14 +12,14 @@
#include "SVGViewView.h"
class Svg2PictureWindow : public BWindow {
public:
Svg2PictureWindow(BRect frame, const char *filename)
: BWindow(frame, "Svg2Picture", B_TITLED_WINDOW, 0) {
BView *view = new Svg2PictureView(Bounds(), filename);
AddChild(view);
}
class Svg2PictureWindow : public BWindow {
public:
Svg2PictureWindow(BRect frame, const char *filename)
: BWindow(frame, "Svg2Picture", B_TITLED_WINDOW, 0) {
BView *view = new Svg2PictureView(Bounds(), filename);
AddChild(view);
}
};
@ -77,7 +77,15 @@ DrawStuff(BView *view)
const rgb_color red = { 240, 0, 0, 0 };
view->SetHighColor(red);
view->SetFontSize(20);
view->DrawString("BPicture test", BPoint(30, 20));
view->DrawString("BPicture ", BPoint(30, 20));
view->DrawString("test");
// DrawLine with pen position
const rgb_color purple = { 200, 0, 220, 0 };
view->SetHighColor(purple);
view->StrokeLine(BPoint(50, 30), BPoint(30, 50));
view->StrokeLine(BPoint(80, 50));
view->StrokeLine(BPoint(50, 30));
}