Bug 103298 - Custom shapes can't have multiple colors
Summary: Custom shapes can't have multiple colors
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Draw (show other bugs)
Version:
(earliest affected)
5.2.2.2 release
Hardware: All All
: medium enhancement
Assignee: Not Assigned
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-17 18:08 UTC by jan d
Modified: 2017-02-04 13:28 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jan d 2016-10-17 18:08:58 UTC
Description:
USER STORY: As a user, I want to use premade graphics (e.g. wireframe UI elements, network components) which look good and behave properly when resized. 

PROBLEM: Custom Shapes (like these:http://lautman.net/mark/coo/index.html) can be defined and contain variables and handles to make them react to resizes or user customization. However, they can have only an outline and a fill color. As far as I am concerned, it is not possible to e.g. define a scrollbar shape, which has a gray background but a orange scroll handle.

ALTERNATIVES: Normal cliparts/ the gallery come to mind, but these shapes/graphics don't have variables nor handles.  
 

Steps to Reproduce:
1. Try to create a custom shape with elements with different fill colors


Actual Results:  
it is not possible

Expected Results:
it is possible


Reproducible: Always

User Profile Reset: No

Additional Info:


User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0
Comment 1 Buovjaga 2016-10-30 20:37:30 UTC
(In reply to jan d from comment #0)
> Steps to Reproduce:
> 1. Try to create a custom shape with elements with different fill colors

This report is about a fairly esoteric subject and that single repro step does not really do justice to the complexity involved.

The creation of custom shapes is described in these articles:
http://books.evc-cit.info/odbook/custom_shapes_article.pdf
https://wiki.openoffice.org/wiki/Create_a_New_Custom_Shape_in_Source_in_File

I took a look at Mark Lautman's "GUI Elements and Controls".

The scrollbar is defined like this in the content.xml:

<draw:custom-shape draw:name="Scrollbar" draw:style-name="UIBlack" draw:text-style-name="P1" draw:layer="layout" svg:width="4cm" svg:height="0.6cm" svg:x="10cm" svg:y="12.5cm">
                <text:p/>
                <draw:enhanced-geometry svg:viewBox="0 0 1000 150" draw:type="NonPrimitive" draw:modifiers="870" draw:enhanced-path="M 0 0 L ?f0 0 ?f0 150 0 150 F Z N M 150 0 L 150 150 F Z N M $0 0 L $0 150 F Z N M 40 75 L 100 40 100 110 Z N M ?f1 75 L ?f2 40 ?f2 110 Z N">
                    <draw:equation draw:name="f0" draw:formula="$0+150"/>
                    <draw:equation draw:name="f1" draw:formula="$0+100"/>
                    <draw:equation draw:name="f2" draw:formula="$0+40"/>
                    <draw:handle draw:handle-position="$0 0" draw:handle-range-x-minimum="150"/>
                </draw:enhanced-geometry>
            </draw:custom-shape>

We can see that all the elements of the shape are drawn in one path definition.
"Z" means "Close sub­path by drawing a line to the beginning point of sub­path."
"N" means "End subpath".

To use different fill colors for the scrollbar background and buttons, we would have to use separate draw:custom-shape elements. However, the problem appears to be that the handle and equations cannot be shared by different shapes.

Regina: what do you think about this? Wouldn't this involve changing the ODF spec?

Btw. thanks for educating me, Jan: I had no idea this was even possible. The use for GUI elements is really intriguing and I have to show this to the LibreOffice design team.
Comment 2 jan d 2016-10-30 20:57:37 UTC
Thanks for the more ODF-oriented and still easy to understand description of the issue.

> The use for GUI elements is really intriguing

Yes, it is. I use Libre Office Draw at my work as well as draw.io (which is open source, too)
Comment 3 Regina Henschel 2017-01-13 19:44:26 UTC
In ODF 1.2 it is not possible. Even the lighten and darken areas you know from shapes in PowerPoint, are not possible in ODF.

https://issues.oasis-open.org/browse/OFFICE-2049 is on the agenda in the TC.

Currently LibreOffice writes additional commands in the path in the own namespace drawooo for lighten and darken. I would prefer, to have a more general solution, which would allow color blending on an individual subpath.

This is a valid enhancement request.