@@ -78,8 +78,8 @@ NUIE::Size NodeUIHeaderPanel::GetMinSize (NUIE::NodeUIDrawingEnvironment& env) c
7878
7979void NodeUIHeaderPanel::Draw (NUIE::NodeUIDrawingEnvironment& env, const NUIE::Rect& rect, NUIE::NodeDrawingImage& drawingImage) const
8080{
81- drawingImage.AddItem (NUIE::DrawingItemConstPtr ( new NUIE::DrawingFillRect (rect, GetBackgroundColor (env) )));
82- drawingImage.AddItem (NUIE::DrawingItemConstPtr ( new NUIE::DrawingText (rect, GetTextFont (env), headerText, NUIE::HorizontalAnchor::Center, NUIE::VerticalAnchor::Center, GetTextColor (env) )), NUIE::DrawingContext::ItemPreviewMode::HideInPreview);
81+ drawingImage.AddItem (std::make_shared< NUIE::DrawingFillRect> (rect, GetBackgroundColor (env)));
82+ drawingImage.AddItem (std::make_shared< NUIE::DrawingText> (rect, GetTextFont (env), headerText, NUIE::HorizontalAnchor::Center, NUIE::VerticalAnchor::Center, GetTextColor (env)), NUIE::DrawingContext::ItemPreviewMode::HideInPreview);
8383}
8484
8585const NUIE::Font& NodeUIHeaderPanel::GetTextFont (NUIE::NodeUIDrawingEnvironment& env) const
@@ -142,9 +142,9 @@ void NodeUIIconHeaderPanel::Draw (NUIE::NodeUIDrawingEnvironment& env, const NUI
142142 double centerOffset = (rect.GetWidth () - minWidth) / 2.0 ;
143143 NUIE::Rect iconRect = NUIE::Rect::FromPositionAndSize (NUIE::Point (rect.GetLeft () + centerOffset, rect.GetTop () + nodePadding), NUIE::Size (iconSize, iconSize));
144144 NUIE::Rect textRect = NUIE::Rect::FromPositionAndSize (NUIE::Point (rect.GetLeft () + centerOffset + iconSize + nodePadding, rect.GetTop ()), NUIE::Size (textSize.GetWidth (), rect.GetHeight ()));
145- drawingImage.AddItem (NUIE::DrawingItemConstPtr ( new NUIE::DrawingFillRect (rect, GetBackgroundColor (env) )));
146- drawingImage.AddItem (NUIE::DrawingItemConstPtr ( new NUIE::DrawingIcon (iconRect, iconId) ), NUIE::DrawingContext::ItemPreviewMode::HideInPreview);
147- drawingImage.AddItem (NUIE::DrawingItemConstPtr ( new NUIE::DrawingText (textRect, GetTextFont (env), headerText, NUIE::HorizontalAnchor::Center, NUIE::VerticalAnchor::Center, GetTextColor (env) )), NUIE::DrawingContext::ItemPreviewMode::HideInPreview);
145+ drawingImage.AddItem (std::make_shared< NUIE::DrawingFillRect> (rect, GetBackgroundColor (env)));
146+ drawingImage.AddItem (std::make_shared< NUIE::DrawingIcon> (iconRect, iconId), NUIE::DrawingContext::ItemPreviewMode::HideInPreview);
147+ drawingImage.AddItem (std::make_shared< NUIE::DrawingText> (textRect, GetTextFont (env), headerText, NUIE::HorizontalAnchor::Center, NUIE::VerticalAnchor::Center, GetTextColor (env)), NUIE::DrawingContext::ItemPreviewMode::HideInPreview);
148148}
149149
150150NodeUITextPanel::NodeUITextPanel (const std::wstring& text) :
@@ -165,8 +165,8 @@ NUIE::Size NodeUITextPanel::GetMinSize (NUIE::NodeUIDrawingEnvironment& env) con
165165void NodeUITextPanel::Draw (NUIE::NodeUIDrawingEnvironment& env, const NUIE::Rect& rect, NUIE::NodeDrawingImage& drawingImage) const
166166{
167167 const NUIE::SkinParams& skinParams = env.GetSkinParams ();
168- drawingImage.AddItem (NUIE::DrawingItemConstPtr ( new NUIE::DrawingFillRect (rect, skinParams.GetTextPanelBackgroundColor () )));
169- drawingImage.AddItem (NUIE::DrawingItemConstPtr ( new NUIE::DrawingText (rect, skinParams.GetNodeContentTextFont (), text, NUIE::HorizontalAnchor::Center, NUIE::VerticalAnchor::Center, skinParams.GetNodeContentTextColor () )), NUIE::DrawingContext::ItemPreviewMode::HideInPreview);
168+ drawingImage.AddItem (std::make_shared< NUIE::DrawingFillRect> (rect, skinParams.GetTextPanelBackgroundColor ()));
169+ drawingImage.AddItem (std::make_shared< NUIE::DrawingText> (rect, skinParams.GetNodeContentTextFont (), text, NUIE::HorizontalAnchor::Center, NUIE::VerticalAnchor::Center, skinParams.GetNodeContentTextColor ()), NUIE::DrawingContext::ItemPreviewMode::HideInPreview);
170170}
171171
172172NodeUIMultiLineTextPanel::NodeUIMultiLineTextPanel (const std::vector<std::wstring>& nodeTexts, size_t allTextCount, size_t textsPerPage, NUIE::NodeUIDrawingEnvironment& env) :
@@ -200,7 +200,7 @@ NUIE::Size NodeUIMultiLineTextPanel::GetMinSize (NUIE::NodeUIDrawingEnvironment&
200200
201201void NodeUIMultiLineTextPanel::Draw (NUIE::NodeUIDrawingEnvironment& env, const NUIE::Rect& rect, NUIE::NodeDrawingImage& drawingImage) const
202202{
203- drawingImage.AddItem (NUIE::DrawingItemConstPtr ( new NUIE::DrawingFillRect (rect, GetBackgroundColor (env) )));
203+ drawingImage.AddItem (std::make_shared< NUIE::DrawingFillRect> (rect, GetBackgroundColor (env)));
204204
205205 const NUIE::SkinParams& skinParams = env.GetSkinParams ();
206206 double nodePadding = skinParams.GetNodePadding ();
@@ -211,7 +211,7 @@ void NodeUIMultiLineTextPanel::Draw (NUIE::NodeUIDrawingEnvironment& env, const
211211 NUIE::Point textRectPosition (rect.GetLeft () + xOffset, rect.GetTop () + yOffset);
212212 NUIE::Size textRectSize (textRectWidth, maxTextSize.GetHeight ());
213213 NUIE::Rect textRect = NUIE::Rect::FromPositionAndSize (textRectPosition, textRectSize);
214- drawingImage.AddItem (NUIE::DrawingItemConstPtr ( new NUIE::DrawingText (textRect, skinParams.GetNodeContentTextFont (), nodeText, NUIE::HorizontalAnchor::Center, NUIE::VerticalAnchor::Center, GetTextColor (env) )), NUIE::DrawingContext::ItemPreviewMode::HideInPreview);
214+ drawingImage.AddItem (std::make_shared< NUIE::DrawingText> (textRect, skinParams.GetNodeContentTextFont (), nodeText, NUIE::HorizontalAnchor::Center, NUIE::VerticalAnchor::Center, GetTextColor (env)), NUIE::DrawingContext::ItemPreviewMode::HideInPreview);
215215 yOffset += maxTextSize.GetHeight ();
216216 }
217217}
@@ -265,7 +265,7 @@ void NodeUISlotPanel::Draw (NUIE::NodeUIDrawingEnvironment& env, const NUIE::Rec
265265 const NUIE::SkinParams& skinParams = env.GetSkinParams ();
266266 double nodePadding = skinParams.GetNodePadding ();
267267
268- drawingImage.AddItem (NUIE::DrawingItemConstPtr ( new NUIE::DrawingFillRect (rect, skinParams.GetNodeContentBackgroundColor () )));
268+ drawingImage.AddItem (std::make_shared< NUIE::DrawingFillRect> (rect, skinParams.GetNodeContentBackgroundColor ()));
269269
270270 NUIE::Point inputSlotsStartPoint = rect.GetTopLeft () + NUIE::Point (0.0 , nodePadding);
271271 inputSlots.Enumerate (SlotRectCollection::RefPointMode::TopLeft, inputSlotsStartPoint, nodePadding, [&] (const NE::SlotId& slotId, const NUIE::Rect& slotRect) {
@@ -276,8 +276,8 @@ void NodeUISlotPanel::Draw (NUIE::NodeUIDrawingEnvironment& env, const NUIE::Rec
276276
277277 if (skinParams.GetSlotMarker () == NUIE::SkinParams::SlotMarker::Circle) {
278278 NUIE::Rect markerRect = NUIE::Rect::FromCenterAndSize (slotRect.GetLeftCenter (), skinParams.GetSlotMarkerSize ());
279- drawingImage.AddItem (NUIE::DrawingItemConstPtr ( new NUIE::DrawingFillEllipse (markerRect, skinParams.GetSlotTextBackgroundColor () )), NUIE::DrawingContext::ItemPreviewMode::HideInPreview);
280- drawingImage.AddItem (NUIE::DrawingItemConstPtr ( new NUIE::DrawingEllipse (markerRect, skinParams.GetConnectionLinePen () )), NUIE::DrawingContext::ItemPreviewMode::HideInPreview);
279+ drawingImage.AddItem (std::make_shared< NUIE::DrawingFillEllipse> (markerRect, skinParams.GetSlotTextBackgroundColor ()), NUIE::DrawingContext::ItemPreviewMode::HideInPreview);
280+ drawingImage.AddItem (std::make_shared< NUIE::DrawingEllipse> (markerRect, skinParams.GetConnectionLinePen ()), NUIE::DrawingContext::ItemPreviewMode::HideInPreview);
281281 }
282282
283283 if (skinParams.GetHiddenSlotMarker () == NUIE::SkinParams::HiddenSlotMarker::Arrow) {
@@ -286,13 +286,13 @@ void NodeUISlotPanel::Draw (NUIE::NodeUIDrawingEnvironment& env, const NUIE::Rec
286286 const NUIE::Size markerSize = skinParams.GetSlotMarkerSize ();
287287 NUIE::Point hiddenConnectionCenter = slotRect.GetLeftCenter () - NUIE::Point (markerSize.GetWidth () / 3.0 * 2.0 , 0.0 );
288288 NUIE::Rect markerRect = NUIE::Rect::FromCenterAndSize (hiddenConnectionCenter, skinParams.GetSlotMarkerSize ());
289- drawingImage.AddItem (NUIE::DrawingItemConstPtr ( new NUIE::DrawingLine (markerRect.GetTopCenter (), markerRect.GetLeftCenter (), skinParams.GetConnectionLinePen () )), NUIE::DrawingContext::ItemPreviewMode::HideInPreview);
290- drawingImage.AddItem (NUIE::DrawingItemConstPtr ( new NUIE::DrawingLine (markerRect.GetLeftCenter (), markerRect.GetBottomCenter (), skinParams.GetConnectionLinePen () )), NUIE::DrawingContext::ItemPreviewMode::HideInPreview);
289+ drawingImage.AddItem (std::make_shared< NUIE::DrawingLine> (markerRect.GetTopCenter (), markerRect.GetLeftCenter (), skinParams.GetConnectionLinePen ()), NUIE::DrawingContext::ItemPreviewMode::HideInPreview);
290+ drawingImage.AddItem (std::make_shared< NUIE::DrawingLine> (markerRect.GetLeftCenter (), markerRect.GetBottomCenter (), skinParams.GetConnectionLinePen ()), NUIE::DrawingContext::ItemPreviewMode::HideInPreview);
291291 }
292292 }
293293
294- drawingImage.AddItem (NUIE::DrawingItemConstPtr ( new NUIE::DrawingFillRect (slotRect, skinParams.GetSlotTextBackgroundColor () )));
295- drawingImage.AddItem (NUIE::DrawingItemConstPtr ( new NUIE::DrawingText (textRect, skinParams.GetNodeContentTextFont (), uiSlot->GetName ().GetLocalized (), NUIE::HorizontalAnchor::Left, NUIE::VerticalAnchor::Center, skinParams.GetSlotTextColor () )), NUIE::DrawingContext::ItemPreviewMode::HideInPreview);
294+ drawingImage.AddItem (std::make_shared< NUIE::DrawingFillRect> (slotRect, skinParams.GetSlotTextBackgroundColor ()));
295+ drawingImage.AddItem (std::make_shared< NUIE::DrawingText> (textRect, skinParams.GetNodeContentTextFont (), uiSlot->GetName ().GetLocalized (), NUIE::HorizontalAnchor::Left, NUIE::VerticalAnchor::Center, skinParams.GetSlotTextColor ()), NUIE::DrawingContext::ItemPreviewMode::HideInPreview);
296296 });
297297
298298 NUIE::Point outputSlotsStartPoint = rect.GetTopRight () + NUIE::Point (0.0 , nodePadding);
@@ -303,11 +303,11 @@ void NodeUISlotPanel::Draw (NUIE::NodeUIDrawingEnvironment& env, const NUIE::Rec
303303 drawingImage.AddOutputSlotRect (slotId, slotRect);
304304 if (skinParams.GetSlotMarker () == NUIE::SkinParams::SlotMarker::Circle) {
305305 NUIE::Rect connCircleRect = NUIE::Rect::FromCenterAndSize (slotRect.GetRightCenter (), skinParams.GetSlotMarkerSize ());
306- drawingImage.AddItem (NUIE::DrawingItemConstPtr ( new NUIE::DrawingFillEllipse (connCircleRect, skinParams.GetSlotTextBackgroundColor () )), NUIE::DrawingContext::ItemPreviewMode::HideInPreview);
307- drawingImage.AddItem (NUIE::DrawingItemConstPtr ( new NUIE::DrawingEllipse (connCircleRect, skinParams.GetConnectionLinePen () )), NUIE::DrawingContext::ItemPreviewMode::HideInPreview);
306+ drawingImage.AddItem (std::make_shared< NUIE::DrawingFillEllipse> (connCircleRect, skinParams.GetSlotTextBackgroundColor ()), NUIE::DrawingContext::ItemPreviewMode::HideInPreview);
307+ drawingImage.AddItem (std::make_shared< NUIE::DrawingEllipse> (connCircleRect, skinParams.GetConnectionLinePen ()), NUIE::DrawingContext::ItemPreviewMode::HideInPreview);
308308 }
309- drawingImage.AddItem (NUIE::DrawingItemConstPtr ( new NUIE::DrawingFillRect (slotRect, skinParams.GetSlotTextBackgroundColor () )));
310- drawingImage.AddItem (NUIE::DrawingItemConstPtr ( new NUIE::DrawingText (textRect, skinParams.GetNodeContentTextFont (), uiSlot->GetName ().GetLocalized (), NUIE::HorizontalAnchor::Right, NUIE::VerticalAnchor::Center, skinParams.GetSlotTextColor () )), NUIE::DrawingContext::ItemPreviewMode::HideInPreview);
309+ drawingImage.AddItem (std::make_shared< NUIE::DrawingFillRect> (slotRect, skinParams.GetSlotTextBackgroundColor ()));
310+ drawingImage.AddItem (std::make_shared< NUIE::DrawingText> (textRect, skinParams.GetNodeContentTextFont (), uiSlot->GetName ().GetLocalized (), NUIE::HorizontalAnchor::Right, NUIE::VerticalAnchor::Center, skinParams.GetSlotTextColor ()), NUIE::DrawingContext::ItemPreviewMode::HideInPreview);
311311 });
312312}
313313
@@ -351,21 +351,21 @@ void NodeUILeftRightButtonsPanel::Draw (NUIE::NodeUIDrawingEnvironment& env, con
351351 const NUIE::Color& backgroundColor = skinParams.GetNodeContentBackgroundColor ();
352352 const NUIE::Color& textColor = skinParams.GetNodeContentTextColor ();
353353
354- drawingImage.AddItem (NUIE::DrawingItemConstPtr ( new NUIE::DrawingFillRect (rect, backgroundColor) ));
354+ drawingImage.AddItem (std::make_shared< NUIE::DrawingFillRect> (rect, backgroundColor));
355355
356356 NUIE::Rect leftButtonRect = NUIE::Rect::FromPositionAndSize (rect.GetTopLeft () + NUIE::Point (nodePadding, nodePadding), leftButtonSize);
357357 NUIE::Rect rightButtonRect = NUIE::Rect::FromPositionAndSize (rect.GetTopRight () - NUIE::Point (rightButtonSize.GetWidth () + nodePadding, -nodePadding), rightButtonSize);
358358 NUIE::Rect textRect = NUIE::Rect::FromPositionAndSize (leftButtonRect.GetTopRight (), NUIE::Size (rightButtonRect.GetLeft () - leftButtonRect.GetRight (), panelTextSize.GetHeight ()));
359- drawingImage.AddItem (NUIE::DrawingItemConstPtr ( new NUIE::DrawingText (textRect, skinParams.GetNodeContentTextFont (), panelText, NUIE::HorizontalAnchor::Center, NUIE::VerticalAnchor::Center, textColor) ), NUIE::DrawingContext::ItemPreviewMode::HideInPreview);
359+ drawingImage.AddItem (std::make_shared< NUIE::DrawingText> (textRect, skinParams.GetNodeContentTextFont (), panelText, NUIE::HorizontalAnchor::Center, NUIE::VerticalAnchor::Center, textColor), NUIE::DrawingContext::ItemPreviewMode::HideInPreview);
360360
361- drawingImage.AddItem (NUIE::DrawingItemConstPtr ( new NUIE::DrawingFillRect (leftButtonRect, skinParams.GetButtonBackgroundColor () )));
362- drawingImage.AddItem (NUIE::DrawingItemConstPtr ( new NUIE::DrawingText (leftButtonRect, skinParams.GetNodeContentTextFont (), leftButtonText, NUIE::HorizontalAnchor::Center, NUIE::VerticalAnchor::Center, textColor) ), NUIE::DrawingContext::ItemPreviewMode::HideInPreview);
363- drawingImage.AddItem (NUIE::DrawingItemConstPtr ( new NUIE::DrawingRect (leftButtonRect, skinParams.GetButtonBorderPen () )));
361+ drawingImage.AddItem (std::make_shared< NUIE::DrawingFillRect> (leftButtonRect, skinParams.GetButtonBackgroundColor ()));
362+ drawingImage.AddItem (std::make_shared< NUIE::DrawingText> (leftButtonRect, skinParams.GetNodeContentTextFont (), leftButtonText, NUIE::HorizontalAnchor::Center, NUIE::VerticalAnchor::Center, textColor), NUIE::DrawingContext::ItemPreviewMode::HideInPreview);
363+ drawingImage.AddItem (std::make_shared< NUIE::DrawingRect> (leftButtonRect, skinParams.GetButtonBorderPen ()));
364364 drawingImage.AddSpecialRect (leftButtonId, leftButtonRect);
365365
366- drawingImage.AddItem (NUIE::DrawingItemConstPtr ( new NUIE::DrawingFillRect (rightButtonRect, skinParams.GetButtonBackgroundColor () )));
367- drawingImage.AddItem (NUIE::DrawingItemConstPtr ( new NUIE::DrawingText (rightButtonRect, skinParams.GetNodeContentTextFont (), rightButtonText, NUIE::HorizontalAnchor::Center, NUIE::VerticalAnchor::Center, textColor) ), NUIE::DrawingContext::ItemPreviewMode::HideInPreview);
368- drawingImage.AddItem (NUIE::DrawingItemConstPtr ( new NUIE::DrawingRect (rightButtonRect, skinParams.GetButtonBorderPen () )));
366+ drawingImage.AddItem (std::make_shared< NUIE::DrawingFillRect> (rightButtonRect, skinParams.GetButtonBackgroundColor ()));
367+ drawingImage.AddItem (std::make_shared< NUIE::DrawingText> (rightButtonRect, skinParams.GetNodeContentTextFont (), rightButtonText, NUIE::HorizontalAnchor::Center, NUIE::VerticalAnchor::Center, textColor), NUIE::DrawingContext::ItemPreviewMode::HideInPreview);
368+ drawingImage.AddItem (std::make_shared< NUIE::DrawingRect> (rightButtonRect, skinParams.GetButtonBorderPen ()));
369369 drawingImage.AddSpecialRect (rightButtonId, rightButtonRect);
370370}
371371
@@ -396,12 +396,12 @@ void NodeUIButtonPanel::Draw (NUIE::NodeUIDrawingEnvironment& env, const NUIE::R
396396 const NUIE::Color& backgroundColor = skinParams.GetNodeContentBackgroundColor ();
397397 const NUIE::Color& textColor = skinParams.GetNodeContentTextColor ();
398398
399- drawingImage.AddItem (NUIE::DrawingItemConstPtr ( new NUIE::DrawingFillRect (rect, backgroundColor) ));
399+ drawingImage.AddItem (std::make_shared< NUIE::DrawingFillRect> (rect, backgroundColor));
400400
401401 NUIE::Rect buttonRect = NUIE::Rect::FromCenterAndSize (rect.GetCenter (), rect.GetSize ().Grow (-2.0 * nodePadding, -2.0 * nodePadding));
402- drawingImage.AddItem (NUIE::DrawingItemConstPtr ( new NUIE::DrawingFillRect (buttonRect, skinParams.GetButtonBackgroundColor () )));
403- drawingImage.AddItem (NUIE::DrawingItemConstPtr ( new NUIE::DrawingText (buttonRect, skinParams.GetNodeContentTextFont (), buttonText, NUIE::HorizontalAnchor::Center, NUIE::VerticalAnchor::Center, textColor) ), NUIE::DrawingContext::ItemPreviewMode::HideInPreview);
404- drawingImage.AddItem (NUIE::DrawingItemConstPtr ( new NUIE::DrawingRect (buttonRect, skinParams.GetButtonBorderPen () )));
402+ drawingImage.AddItem (std::make_shared< NUIE::DrawingFillRect> (buttonRect, skinParams.GetButtonBackgroundColor ()));
403+ drawingImage.AddItem (std::make_shared< NUIE::DrawingText> (buttonRect, skinParams.GetNodeContentTextFont (), buttonText, NUIE::HorizontalAnchor::Center, NUIE::VerticalAnchor::Center, textColor), NUIE::DrawingContext::ItemPreviewMode::HideInPreview);
404+ drawingImage.AddItem (std::make_shared< NUIE::DrawingRect> (buttonRect, skinParams.GetButtonBorderPen ()));
405405 drawingImage.AddSpecialRect (buttonRectId, buttonRect);
406406}
407407
0 commit comments