422 views
in Embedded Wizard Studio by
Hi,

I am replacing an old gauge with the new one as the path and d ends are a great addition however when I use a start and finish d end, the colour inverts when they overlap (ie at 360 degrees).

Can this be disabled so they just merge?

Thanks

Phil

1 Answer

0 votes
by
 
Best answer

Hello Phil,

I suppose you are referring to the following problem as demonstrated in the screenshot below. When the Gauge widget is configured to display the track with rounded start/end caps and the start and the end of the track join together, the rounded track caps overlap. Is this the case?

The probleme here is the default fill-rule for the path views used in the Gauge widget. The gauge displays the tracks by using the Filled Path view. This view is configured to fill the path with the EvenOdd fill-rule. With this rule, as soon as two areas of the same path overlap, the resulting intersection area is considered as lying outside the path. This is correct behavior for the even-odd fill-rule. In your particular case it is necessary to modify the initialization of the path views to use the NonZero fill-rule. With NonZero fill-rule the intersection area is not excluded.

The difficulty here: the corresponding initialization is implemented in the Gauge widget and is not intended for configuration. Moreover, the Gauge widget is part of the Mosaic framework and it can't be modified. What you can do, however, is to override the Gauge widget class by a new static variant and implement in this variant the necessary code to correct the initialization of the affected views. Following are the steps how to do this:

1. Follow the steps described in this section to create a variant of the class WidgetSet::Gauge. Ensure, you store the variant in one of your own project unit. Don't store it in a Mosaic unit.

2. Once the variant is created double click on it to open the variant for editting in Composer.

3. Follow the steps described in this section to override the method UpdateViewState. The variant inherits this method from the original WidgetSet::Gauge class.

4. Double click on the just overridden UpdateViewState method to open it in the Code Editor.

5. Implement following code in the method.

super( aState );

if ( pathView1 != null ) pathView1.FillRule = Graphics::FillRule.NonZero;
if ( pathView2 != null ) pathView2.FillRule = Graphics::FillRule.NonZero;

That's all. All Gauge instances in your application involve now automatically the just created variant. Accordingly, the fill-rule initialization of the path views used in the Gauge is corrected. 

Does it help you further?

With the next version we will correct the fill-rule initialization of the path views used in the Gauge and Rotary Knob widgets.

Best regards

Paul Banach

by
Hi Paul,

That worked perfectly, thanks for your help.

Best Regards

Phil

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...