mirror of
https://github.com/mcneel/opennurbs.git
synced 2026-03-23 02:39:30 +08:00
Sync changes from upstream repository
Co-authored-by: Andrew Le Bihan <andy@mcneel.com> Co-authored-by: chuck <chuck@mcneel.com> Co-authored-by: Dale Fugier <dale@mcneel.com> Co-authored-by: Dale Lear <dalelear@mcneel.com> Co-authored-by: David Eränen <david.eranen@mcneel.com> Co-authored-by: Greg Arden <greg@mcneel.com> Co-authored-by: John Croudy <john.croudy@mcneel.com> Co-authored-by: Lowell Walmsley <lowell@mcneel.com> Co-authored-by: Nathan Letwory <nathan@mcneel.com> Co-authored-by: piac <giulio@mcneel.com> Co-authored-by: Steve Baer <steve@mcneel.com> Co-authored-by: Tim Hemmelman <tim@mcneel.com>
This commit is contained in:
@@ -3457,6 +3457,16 @@ const ON_Font& ON_DimStyle::Font() const
|
||||
return (nullptr != m_managed_font) ? *m_managed_font : ON_Font::Default;
|
||||
}
|
||||
|
||||
const ON_Font& ON_DimStyle::ParentDimStyleFont() const
|
||||
{
|
||||
// If this dimstyle has a parent dimstyle and this dimstyle's font overrides the parent dimstyle's font,
|
||||
// then the parent dimstyle's font is returned. Otherwise this dimstyle's font is returned.
|
||||
return
|
||||
(nullptr != m_parent_dimstyle_managed_font && false == (ON_nil_uuid == ParentId()) && IsFieldOverride(ON_DimStyle::field::Font) )
|
||||
? *m_parent_dimstyle_managed_font
|
||||
: Font();
|
||||
}
|
||||
|
||||
const bool ON_DimStyle::FontSubstituted() const
|
||||
{
|
||||
return
|
||||
@@ -5205,6 +5215,7 @@ void ON_DimStyle::OverrideFields(const ON_DimStyle& source, const ON_DimStyle& p
|
||||
{
|
||||
SetParentId(parent.Id());
|
||||
}
|
||||
m_parent_dimstyle_managed_font = parent.m_managed_font;
|
||||
|
||||
// leave the Unset, Name, Index fields as is. They cannot be overridden
|
||||
for (unsigned int i = static_cast<unsigned int>(ON_DimStyle::field::Index)+1; i < static_cast<unsigned int>(ON_DimStyle::field::Count); i++)
|
||||
|
||||
Reference in New Issue
Block a user