# Linux implementation requests

**URL:** <https://forums.steinberg.net/t/linux-implementation-requests/793628>\
**Category:** VSTGUI\
**Created:** [June 27, 2022, 5:12am UTC](https://forums.steinberg.net/t/linux-implementation-requests/793628 "2022-06-27T05:12:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rjonkman](https://avatars.discourse-cdn.com/v4/letter/r/b5e925/32.png) [@rjonkman](https://forums.steinberg.net/u/rjonkman)\
**Post date:** [June 27, 2022, 5:12am UTC](https://forums.steinberg.net/t/linux-implementation-requests/793628/1 "2022-06-27T05:12:00Z")

</div>

I think I now have the Linux code base working well enough my current needs. I realize that you guys are incredibly busy, but if you find time to develop the Linux code base, here are a few unimplemented features I’d love to see:

- Linear Gradients with transformations
- Radial Gradients (also with transformations)
- Text Path (this looks like it’s not even possible)

---

<div class="post-metadata">

**Author:** ![rjonkman](https://avatars.discourse-cdn.com/v4/letter/r/b5e925/32.png) [@rjonkman](https://forums.steinberg.net/u/rjonkman)\
**Post date:** [July 4, 2022, 1:56am UTC](https://forums.steinberg.net/t/linux-implementation-requests/793628/2 "2022-07-04T01:56:42Z")

</div>

I managed to implement the first two of these on my own,

---

<div class="post-metadata">

**Author:** ![Arne\_Scheffler](https://dub1.discourse-cdn.com/steinberg/user_avatar/forums.steinberg.net/arne_scheffler/32/92023_2.png) [@Arne\_Scheffler](https://forums.steinberg.net/u/Arne_Scheffler)\
**Post date:** [July 8, 2022, 2:39pm UTC](https://forums.steinberg.net/t/linux-implementation-requests/793628/3 "2022-07-08T14:39:39Z")

</div>

Maybe you like to share the implementation for it?

---

<div class="post-metadata">

**Author:** ![rjonkman](https://avatars.discourse-cdn.com/v4/letter/r/b5e925/32.png) [@rjonkman](https://forums.steinberg.net/u/rjonkman)\
**Post date:** [July 9, 2022, 1:06pm UTC](https://forums.steinberg.net/t/linux-implementation-requests/793628/4 "2022-07-09T13:06:44Z")

</div>

I think I sent a pull request, but I’m just getting my feet wet with Github, so my commits are all over the place. I’ll post the code here.  
cairocontext.cpp

```auto
void Context::fillRadialGradient (CGraphicsPath* path, const CGradient& gradient,
								  const CPoint& center, CCoord radius, const CPoint& originOffset,
								  bool evenOdd, CGraphicsTransform* transformation)
{
    if (path)
    {
        auto graphicsPath = dynamic_cast<GraphicsPath*> (
            path->getPlatformPath (PlatformGraphicsPathFillMode::Ignored).get ());
        if (!graphicsPath)
            return;
        std::unique_ptr<GraphicsPath> alignedPath;
        if (needPixelAlignment (getDrawMode ()))
            alignedPath = graphicsPath->copyPixelAlign (getCurrentTransform ());
        if (auto cairoGradient = dynamic_cast<Gradient*> (gradient.getPlatformGradient ().get ()))
        {
            if (auto cd = DrawBlock::begin (*this))
            {
                auto p = alignedPath ? alignedPath->getCairoPath () : graphicsPath->getCairoPath ();

                cairo_set_source (cr, cairoGradient->getRadialGradient (center, radius, originOffset));

                if (transformation)
                {
                    cairo_matrix_t currentMatrix;
                    cairo_matrix_t resultMatrix;
                    auto matrix = convert (*transformation);
                    cairo_get_matrix (cr, &currentMatrix);
                    cairo_matrix_multiply (&resultMatrix, &matrix, &currentMatrix);
                    cairo_set_matrix (cr, &resultMatrix);
                }

                cairo_append_path (cr, p);

                if (evenOdd)
                {
                    cairo_set_fill_rule (cr, CAIRO_FILL_RULE_EVEN_ODD);
                    cairo_fill (cr);
                }
                else
                {
                    cairo_fill (cr);
                }
            }
        }
    }
}

```

Line 23 of cairogradient.h

```auto
const PatternHandle& getRadialGradient (CPoint center, CCoord radius, CPoint offset);

```

cairogradient.cpp

```auto
const PatternHandle& Gradient::getRadialGradient (CPoint center, CCoord radius, CPoint offset)
{
	if (!radialGradient)
	{
        radialGradient = PatternHandle (cairo_pattern_create_radial (center.x, center.y, 0, center.x + offset.x, center.y + offset.y, radius));
		for (auto& it : getColorStops ())
		{
			cairo_pattern_add_color_stop_rgba (
                radialGradient, it.first, it.second.normRed<double> (),
                it.second.normGreen<double> (), it.second.normBlue<double> (),
                it.second.normAlpha<double> ());
		}
	}
	return radialGradient;
}

```
