forked from misakamm/xege
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: 修复部分函数使用 ege_transform_matrix 参数做变换时崩溃的问题 (#234)
* fix: 修复 ege_path 相关函数传入 ege_transform_matrix 参数会导致崩溃的问题 * fix: 修复坐标变换中变换矩阵参数为 NULL 时引起程序崩溃的问题 * refactor: 使用 Gdiplus::Matrix 类的 TransformPoints 函数对坐标进行变换 * refactor: 变换矩阵类型转换改为由引用返回结果 * refactor: 矩阵类型转换使用引用参数
- Loading branch information
Showing
3 changed files
with
97 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#include "ege_head.h" | ||
#include "gdi_conv.h" | ||
|
||
namespace ege | ||
{ | ||
|
||
/** | ||
* 将 ege_transform_matrix 类型转换为 Gdiplus::Matrix 类型 | ||
* @param[in] from 输入的矩阵 | ||
* @param[out] to 保存转换结果 | ||
*/ | ||
void matrixConvert(const ege_transform_matrix& from, Gdiplus::Matrix& to) | ||
{ | ||
to.SetElements(from.m11, from.m12, from.m21, from.m22, from.m31, from.m32); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#pragma once | ||
|
||
#include "ege_head.h" | ||
|
||
namespace ege | ||
{ | ||
/* 矩阵类型转换 */ | ||
void matrixConvert(const ege_transform_matrix& from, Gdiplus::Matrix& to); | ||
} |