四个方向 分块渲染
This commit is contained in:
@@ -81,7 +81,8 @@ private:
|
||||
coordinates,
|
||||
state.orientation == Orientation::Horizontal ? static_cast<double>(state.x)
|
||||
: static_cast<double>(state.y),
|
||||
static_cast<double>(state.pixel_length)
|
||||
static_cast<double>(state.pixel_length),
|
||||
state.orientation
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ struct Axis_Transform {
|
||||
Range coordinate_range;
|
||||
double pixel_origin{};
|
||||
double pixel_length{};
|
||||
Orientation orientation = Orientation::Horizontal;
|
||||
|
||||
[[nodiscard]] double coord_to_pixel(double coordinate) const noexcept {
|
||||
const double span = coordinate_range.length();
|
||||
@@ -23,6 +24,10 @@ struct Axis_Transform {
|
||||
return coordinate_range.origin;
|
||||
return coordinate_range.origin + (pixel - pixel_origin) / pixel_length * coordinate_range.length();
|
||||
}
|
||||
|
||||
[[nodiscard]] double point_to_coord(PointF point) const noexcept {
|
||||
return pixel_to_coord(orientation == Orientation::Horizontal ? point.x : point.y);
|
||||
}
|
||||
};
|
||||
|
||||
struct Axis_Base_Properties {
|
||||
|
||||
Reference in New Issue
Block a user