diff --git a/src/laybasic/laybasic/layBitmapsToImage.cc b/src/laybasic/laybasic/layBitmapsToImage.cc index 2c0ca533b..dbd8bbc64 100644 --- a/src/laybasic/laybasic/layBitmapsToImage.cc +++ b/src/laybasic/laybasic/layBitmapsToImage.cc @@ -510,7 +510,7 @@ bitmaps_to_image_rgb (const std::vector &view_ops_in, if (pb != 0 && w > 0 - && (pb->first_scanline () + w - 1 < y + slice && pb->last_scanline () > y + w - 1) + && ((pb->first_scanline () < y + slice && pb->last_scanline () > y) || w > 1) && (vop.ormask () | ~vop.andmask ()) != 0) { uint32_t non_empty_sl = 0; @@ -748,7 +748,7 @@ bitmaps_to_image_mono (const std::vector &view_ops_in, if (pb != 0 && w > 0 - && (pb->first_scanline () + w - 1 < y + slice && pb->last_scanline () > y + w - 1) + && ((pb->first_scanline () < y + slice && pb->last_scanline () > y) || w > 1) && (vop.ormask () | ~vop.andmask ()) != 0) { uint32_t non_empty_sl = 0; diff --git a/src/laybasic/laybasic/layRedrawLayerInfo.h b/src/laybasic/laybasic/layRedrawLayerInfo.h index 3befe4c33..60865b241 100644 --- a/src/laybasic/laybasic/layRedrawLayerInfo.h +++ b/src/laybasic/laybasic/layRedrawLayerInfo.h @@ -74,9 +74,10 @@ struct RedrawLayerInfo /** * @brief The layer index * - * The logical layer to draw. If this member is <0 and the cellview_index is <0, it is an invalid layer, - * which is ignored. If the cellview_index is >=0, it denotes a "cell frame" pseudo - * layer. It is set by the constructor. + * The logical layer to draw. The layer index can be <0 which indicates a + * layer with not layout source (cell_frame may be true to indicate a + * pseudo layer then). + * This attribute is set by the constructor. */ int layer_index; @@ -115,6 +116,14 @@ struct RedrawLayerInfo * This member is set by the constructor. */ bool inverse_prop_sel; + + /** + * @brief Returns true, if the layer needs to be drawn + */ + bool needs_drawing () const + { + return visible && enabled && (cell_frame || layer_index >= 0) && cellview_index >= 0; + } }; } diff --git a/src/laybasic/laybasic/layRedrawThread.cc b/src/laybasic/laybasic/layRedrawThread.cc index f71f15e00..757692ada 100644 --- a/src/laybasic/laybasic/layRedrawThread.cc +++ b/src/laybasic/laybasic/layRedrawThread.cc @@ -307,7 +307,7 @@ RedrawThread::do_start (bool clear, const db::Vector *shift_vector, const std::v } for (int i = 0; i < m_nlayers; ++i) { - if (m_layers [i].visible && m_layers [i].enabled) { + if (m_layers [i].needs_drawing ()) { schedule (new RedrawThreadTask (i)); } }