Can now display SVGs, also fixed bad function call bug when taking screenshot
This commit is contained in:
parent
6d8d532952
commit
91603e1fc1
9 changed files with 70 additions and 28 deletions
19
src/ResourceDisplay/SvgResourceDisplay.hpp
Normal file
19
src/ResourceDisplay/SvgResourceDisplay.hpp
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
#pragma once
|
||||
#include "ResourceDisplay.hpp"
|
||||
#include <include/core/SkImage.h>
|
||||
#include <vector>
|
||||
#include <modules/svg/include/SkSVGDOM.h>
|
||||
|
||||
class SvgResourceDisplay : public ResourceDisplay {
|
||||
public:
|
||||
virtual void update(World& w) override;
|
||||
virtual bool load(const std::string& fileName, const std::string& fileData) override;
|
||||
virtual bool update_draw() const override;
|
||||
virtual void draw(SkCanvas* canvas, const DrawData& drawData, const SkRect& imRect) override;
|
||||
virtual Vector2f get_dimensions() const override;
|
||||
virtual float get_dimension_scale() const override;
|
||||
private:
|
||||
sk_sp<SkSVGDOM> svgDom;
|
||||
bool mustUpdateDraw = false;
|
||||
SkSize svgRootSize;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue