208 case EObjectOrigin: |
208 case EObjectOrigin: |
209 { |
209 { |
210 LDBoundingBox box; |
210 LDBoundingBox box; |
211 |
211 |
212 // Calculate center vertex |
212 // Calculate center vertex |
213 for (LDObject* obj : objs) |
213 for (LDObjectPtr obj : objs) |
214 { |
214 { |
215 if (obj->hasMatrix()) |
215 if (obj->hasMatrix()) |
216 box << dynamic_cast<LDMatrixObject*> (obj)->position(); |
216 box << obj.dynamicCast<LDMatrixObject>()->position(); |
217 else |
217 else |
218 box << obj; |
218 box << obj; |
219 } |
219 } |
220 |
220 |
221 return box.center(); |
221 return box.center(); |