View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0017083 | Scribus | Canvas | public | 2023-12-19 23:33 | 2023-12-24 10:00 |
| Reporter | nitramr | Assigned To | nitramr | ||
| Priority | normal | Severity | minor | Reproducibility | always |
| Status | closed | Resolution | fixed | ||
| Platform | Desktop PC | OS | Ubuntu | OS Version | 23.10 64-bit |
| Product Version | 1.5.8 | ||||
| Fixed in Version | 1.6.0.svn | ||||
| Summary | 0017083: Changing the line blend mode has no effect on the canvas | ||||
| Description | It seems like virtual void ScPainter::setBlendModeStroke(int) always get 0 instead of the number of the selected blend mode. The blend mode is set correctly in void PageItem::setLineBlendmode(int newBlendmode) | ||||
| Steps To Reproduce | 1. Create a new document 2. draw a line item 3. go to transparency settings of item and change line blend mode to another mode => no changes on canvas | ||||
| Tags | No tags attached. | ||||
| Patch | Yes | ||||
|
|
I found the issue. Strokes of a page item are usually drawn in PageItem::DrawObj_Post(ScPainter *p) Page items without a fill, like Line, PolyLine or Spiral are explicitly excluded from that post drawing, because those objects are already draw strokes in their local DrawObj_Post(ScPainter *p) function. When I set p->setBlendModeStroke(lineBlendmode()); in PageItem_Line::DrawObj_Item it works, and the item blending is visible on canvas. I try to provide a patch for that. Blend mode is at least supported in PDF export, but not on canvas. |
|
|
Patch attached. Fixes blend mode for: - Line Items - Spiral Items - Poly Line Items lineblendmode_2023-12-20_01.patch (1,717 bytes)
Index: scribus/pageitem.cpp
===================================================================
--- scribus/pageitem.cpp (Revision 25886)
+++ scribus/pageitem.cpp (Arbeitskopie)
@@ -10012,7 +10012,9 @@
if (m_Doc->layerOutline(m_layerID))
p->strokePath();
else
- {
+ {
+ p->setBlendModeStroke(lineBlendmode());
+ p->setBlendModeFill(lineBlendmode()); // needed for fill in arrow shapes
if (NamedLStyle.isEmpty())
{
ScPattern *strokePattern = m_Doc->checkedPattern(patternStrokeVal);
Index: scribus/pageitem_line.cpp
===================================================================
--- scribus/pageitem_line.cpp (Revision 25886)
+++ scribus/pageitem_line.cpp (Arbeitskopie)
@@ -61,6 +61,7 @@
p->drawLine(FPoint(0, 0), FPoint(m_width, 0));
else
{
+ p->setBlendModeStroke(lineBlendmode());
if (NamedLStyle.isEmpty())
{
ScPattern *strokePattern = m_Doc->checkedPattern(patternStrokeVal);
Index: scribus/pageitem_polyline.cpp
===================================================================
--- scribus/pageitem_polyline.cpp (Revision 25886)
+++ scribus/pageitem_polyline.cpp (Arbeitskopie)
@@ -58,6 +58,7 @@
if (!m_Doc->layerOutline(m_layerID))
{
+ p->setBlendModeStroke(lineBlendmode());
if ((fillColor() != CommonStrings::None) || (GrType != 0))
{
FPointArray cli;
Index: scribus/pageitem_spiral.cpp
===================================================================
--- scribus/pageitem_spiral.cpp (Revision 25886)
+++ scribus/pageitem_spiral.cpp (Arbeitskopie)
@@ -82,6 +82,7 @@
if (!m_Doc->layerOutline(m_layerID))
{
+ p->setBlendModeStroke(lineBlendmode());
if ((fillColor() != CommonStrings::None) || (GrType != 0))
{
FPointArray cli;
|
|
|
Thanks. For some reason, the p->setBlendModeStroke(lineBlendmode()) calls in PageItem::DrawObj_Post() are guarded with a corresponding p->setBlendModeStroke(0) call. So I added these guards to your patch. I completed your patch by a similar one for the Windows printing side as Windows printing was suffering from a similar issue. |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2023-12-19 23:33 | nitramr | New Issue | |
| 2023-12-19 23:44 | nitramr | Description Updated | |
| 2023-12-20 13:14 | nitramr | Note Added: 0050641 | |
| 2023-12-20 13:43 | nitramr | Note Added: 0050642 | |
| 2023-12-20 13:43 | nitramr | File Added: lineblendmode_2023-12-20_01.patch | |
| 2023-12-20 13:43 | nitramr | Summary | Changing the line blend mode has no effect on the canvas => [Patch] Changing the line blend mode has no effect on the canvas |
| 2023-12-20 13:43 | nitramr | Patch | No => Yes |
| 2023-12-20 23:10 | jghali | Summary | [Patch] Changing the line blend mode has no effect on the canvas => Changing the line blend mode has no effect on the canvas |
| 2023-12-20 23:18 | jghali | Assigned To | => nitramr |
| 2023-12-20 23:18 | jghali | Status | new => resolved |
| 2023-12-20 23:18 | jghali | Resolution | open => fixed |
| 2023-12-20 23:18 | jghali | Fixed in Version | => 1.6.0.svn |
| 2023-12-20 23:18 | jghali | Note Added: 0050666 | |
| 2023-12-24 10:00 | cbradney | Status | resolved => closed |