mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-01 09:42:09 +08:00
fix wrong type (int instead of coord_t) (PR #12302)
This commit is contained in:
parent
8700c12cc0
commit
ae0824a10d
@ -322,9 +322,9 @@ void CreateObjectJob::process(Ctl &ctl)
|
|||||||
Points bed_shape_;
|
Points bed_shape_;
|
||||||
bed_shape_.reserve(m_input.bed_shape.size());
|
bed_shape_.reserve(m_input.bed_shape.size());
|
||||||
for (const Vec2d &p : m_input.bed_shape)
|
for (const Vec2d &p : m_input.bed_shape)
|
||||||
bed_shape_.emplace_back(p.cast<int>());
|
bed_shape_.emplace_back(p.cast<coord_t>());
|
||||||
Slic3r::Polygon bed(bed_shape_);
|
Slic3r::Polygon bed(bed_shape_);
|
||||||
if (!bed.contains(bed_coor.cast<int>()))
|
if (!bed.contains(bed_coor.cast<coord_t>()))
|
||||||
// mouse pose is out of build plate so create object in center of plate
|
// mouse pose is out of build plate so create object in center of plate
|
||||||
bed_coor = bed.centroid().cast<double>();
|
bed_coor = bed.centroid().cast<double>();
|
||||||
|
|
||||||
|
@ -542,7 +542,7 @@ bool start_dragging(const Vec2d &mouse_pos,
|
|||||||
// zero point of volume in world coordinate system
|
// zero point of volume in world coordinate system
|
||||||
Vec3d volume_center = to_world.translation();
|
Vec3d volume_center = to_world.translation();
|
||||||
// screen coordinate of volume center
|
// screen coordinate of volume center
|
||||||
Vec2i coor = CameraUtils::project(camera, volume_center);
|
Point coor = CameraUtils::project(camera, volume_center);
|
||||||
Vec2d mouse_offset = coor.cast<double>() - mouse_pos;
|
Vec2d mouse_offset = coor.cast<double>() - mouse_pos;
|
||||||
Vec2d mouse_offset_without_sla_shift = mouse_offset;
|
Vec2d mouse_offset_without_sla_shift = mouse_offset;
|
||||||
if (double sla_shift = gl_volume.get_sla_shift_z(); !is_approx(sla_shift, 0.)) {
|
if (double sla_shift = gl_volume.get_sla_shift_z(); !is_approx(sla_shift, 0.)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user