259 } else { |
259 } else { |
260 if (obj->color () == maincolor) |
260 if (obj->color () == maincolor) |
261 qcol = getMainColor (); |
261 qcol = getMainColor (); |
262 else { |
262 else { |
263 color* col = getColor (obj->color ()); |
263 color* col = getColor (obj->color ()); |
264 qcol = col->faceColor; |
264 |
|
265 if( col ) |
|
266 qcol = col->faceColor; |
265 } |
267 } |
266 |
268 |
267 if (obj->color () == edgecolor) { |
269 if (obj->color () == edgecolor) { |
268 qcol = luma (m_bgcolor) < 40 ? QColor (64, 64, 64) : Qt::black; |
270 qcol = luma (m_bgcolor) < 40 ? QColor (64, 64, 64) : Qt::black; |
269 color* col; |
271 color* col; |
270 |
272 |
271 if (!gl_blackedges && obj->parent () != null && (col = getColor (obj->parent ()->color ())) != null) |
273 if (!gl_blackedges && obj->parent () && (col = getColor (obj->parent ()->color ()))) |
272 qcol = col->edgeColor; |
274 qcol = col->edgeColor; |
273 } |
275 } |
274 |
276 |
275 if (qcol.isValid () == false) { |
277 if (qcol.isValid () == false) { |
276 // The color was unknown. Use main color to make the object at least |
278 // The color was unknown. Use main color to make the object at least |