Skip to content

Commit 95b32f6

Browse files
authored
Fix missed redraw on batch xf change (#5926)
1 parent d62234c commit 95b32f6

3 files changed

Lines changed: 10 additions & 1 deletion

File tree

source/MRMesh/MRObject.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,14 @@ void Object::resetXf( ViewportId id )
194194
needRedraw_ = true;
195195
}
196196

197+
void Object::setXfsForAllViewports( ViewportProperty<AffineXf3f> xf )
198+
{
199+
if ( xf_ == xf )
200+
return;
201+
xf_ = std::move( xf );
202+
needRedraw_ = true;
203+
}
204+
197205
AffineXf3f Object::worldXf( ViewportId id, bool * isDef ) const
198206
{
199207
auto xf = xf_.get( id, isDef );

source/MRMesh/MRObject.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ class MRMESH_CLASS Object : public ObjectChildrenHolder
112112
/// returns xfs for all viewports, combined into a single object
113113
const ViewportProperty<AffineXf3f> & xfsForAllViewports() const { return xf_; }
114114
/// modifies xfs for all viewports at once
115-
virtual void setXfsForAllViewports( ViewportProperty<AffineXf3f> xf ) { xf_ = std::move( xf ); }
115+
MRMESH_API virtual void setXfsForAllViewports( ViewportProperty<AffineXf3f> xf );
116116

117117
/// this space to world space transformation for default or specific viewport
118118
/// \param isDef receives true if the object has default transformation in this viewport (same as worldXf() returns)

source/MRMesh/MRViewportProperty.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class ViewportProperty
1818
public:
1919
ViewportProperty() = default;
2020
ViewportProperty( const T& def ) :def_{ def } {}
21+
bool operator==( const ViewportProperty& ) const = default;
2122
/// sets default property value
2223
void set( T def ) { def_ = std::move( def ); }
2324
/// gets default property value

0 commit comments

Comments
 (0)