Add svg conversion.
This commit is contained in:
parent
1f85954e98
commit
dfbc87cb09
33 changed files with 602 additions and 79 deletions
|
@ -3,6 +3,8 @@
|
|||
#include "DirectX2dInterface.h"
|
||||
#include "AbstractGeometricItem.h"
|
||||
#include "Rectangle.h"
|
||||
#include "Circle.h"
|
||||
|
||||
#include "SceneModel.h"
|
||||
|
||||
void DirectX2dPainter::startDrawing()
|
||||
|
@ -49,6 +51,25 @@ void DirectX2dPainter::paint(SceneModel* model)
|
|||
rt->DrawRectangle(d2d_rect, mSolidBrush.Get(), 1.0f);
|
||||
}
|
||||
}
|
||||
else if (model->getGeometry()->getType() == AbstractGeometricItem::Type::CIRCLE)
|
||||
{
|
||||
const auto loc = model->getTransform().getLocation();
|
||||
const auto scale_x = model->getTransform().getScaleX();
|
||||
const auto scale_y = model->getTransform().getScaleY();
|
||||
|
||||
auto circle = dynamic_cast<Circle*>(model->getGeometry());
|
||||
const auto radius = circle->getRadius() * scale_x;
|
||||
const auto radiusy = circle->getMinorRadius() * scale_y;
|
||||
|
||||
D2D1_POINT_2F d2d_centre{ static_cast<float>(loc.getX()), static_cast<float>(loc.getY()) };
|
||||
D2D1_ELLIPSE ellipse{ d2d_centre, static_cast<float>(radius), static_cast<float>(radiusy) };
|
||||
|
||||
if (model->hasOutlineColor())
|
||||
{
|
||||
mSolidBrush->SetColor(toD2dColor(model->getOutlineColor()));
|
||||
rt->DrawEllipse(ellipse, mSolidBrush.Get(), 1.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DirectX2dPainter::setD2dInterface(DirectX2dInterface* d2dIterface)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue