Skip to main content
awiernie
Associate III
October 15, 2025
Solved

TouchGFX 4.26.0: faulty code generated with Shape

  • October 15, 2025
  • 2 replies
  • 242 views

After updating from TouchGFX 4.24.x to 4.26.0, the code generated cannot be compiled w/o manual correction - there are commas missing:

 

const touchgfx::AbstractShape::ShapePoint<float> downArrowDisplayPoints[4] = { { 0.0f, 0.0f }, { 80.0f, 0.0f }, { 40.0f, 10.0f }{ 40.0f, 10.0f } };

downArrowDisplay.setShape(downArrowDisplayPoints);

downArrowDisplay.setVisible(false);

add(downArrowDisplay);

 

upArrowDisplay.setPosition(80, 61, 80, 10);

upArrowDisplay.setOrigin(0.0f, 0.0f);

upArrowDisplay.setScale(1.0f, 1.0f);

upArrowDisplay.setAngle(0.0f);

upArrowDisplayPainter.setColor(touchgfx::Color::getColorFromRGB(217, 141, 0));

upArrowDisplay.setPainter(upArrowDisplayPainter);

const touchgfx::AbstractShape::ShapePoint<float> upArrowDisplayPoints[4] = { { 40.0f, 0.0f }{ 80.0f, 10.0f }, { 0.0f, 10.0f }, { 40.0f, 0.0f } };

upArrowDisplay.setShape(upArrowDisplayPoints);

upArrowDisplay.setVisible(false);

add(upArrowDisplay);

 

upArrowLed.setPosition(80, 191, 80, 10);

upArrowLed.setOrigin(0.0f, 0.0f);

upArrowLed.setScale(1.0f, 1.0f);

upArrowLed.setAngle(0.0f);

upArrowLedPainter.setColor(touchgfx::Color::getColorFromRGB(217, 141, 0));

upArrowLed.setPainter(upArrowLedPainter);

const touchgfx::AbstractShape::ShapePoint<float> upArrowLedPoints[4] = { { 40.0f, 0.0f }{ 80.0f, 10.0f }, { 0.0f, 10.0f }, { 40.0f, 0.0f } };

upArrowLed.setShape(upArrowLedPoints);

upArrowLed.setVisible(false);

add(upArrowLed);

 

downArrowLed.setPosition(81, 286, 80, 10);

downArrowLed.setOrigin(0.0f, 0.0f);

downArrowLed.setScale(1.0f, 1.0f);

downArrowLed.setAngle(0.0f);

downArrowLedPainter.setColor(touchgfx::Color::getColorFromRGB(217, 141, 0));

downArrowLed.setPainter(downArrowLedPainter);

const touchgfx::AbstractShape::ShapePoint<float> downArrowLedPoints[4] = { { 0.0f, 0.0f }, { 80.0f, 0.0f }, { 40.0f, 10.0f }{ 40.0f, 10.0f } };

downArrowLed.setShape(downArrowLedPoints);

downArrowLed.setVisible(false);

add(downArrowLed);

 

 

 

Snippet the .touchgfx file:

{
"Type": "Shape",
"Name": "downArrowDisplay",
"X": 80,
"Y": 155,
"Width": 80,
"Height": 10,
"Visible": false,
"Color": {
"Red": 217,
"Green": 141
},
"Points": [
{},
{
"X": 80.0
},
{
"X": 40.0,
"Y": 10.0
},
{
"X": 40.0,
"Y": 10.0
}
],
"XScale": 1.0,
"YScale": 1.0
},
{
"Type": "Shape",
"Name": "upArrowDisplay",
"X": 80,
"Y": 61,
"Width": 80,
"Height": 10,
"Visible": false,
"Color": {
"Red": 217,
"Green": 141
},
"Points": [
{
"X": 40.0
},
{
"X": 80.0,
"Y": 10.0
},
{
"Y": 10.0
},
{
"X": 40.0
}
],
"XScale": 1.0,
"YScale": 1.0
},
{
"Type": "Shape",
"Name": "upArrowLed",
"X": 80,
"Y": 191,
"Width": 80,
"Height": 10,
"Visible": false,
"Color": {
"Red": 217,
"Green": 141
},
"Points": [
{
"X": 40.0
},
{
"X": 80.0,
"Y": 10.0
},
{
"Y": 10.0
},
{
"X": 40.0
}
],
"XScale": 1.0,
"YScale": 1.0
},
{
"Type": "Shape",
"Name": "downArrowLed",
"X": 81,
"Y": 286,
"Width": 80,
"Height": 10,
"Visible": false,
"Color": {
"Red": 217,
"Green": 141
},
"Points": [
{},
{
"X": 80.0
},
{
"X": 40.0,
"Y": 10.0
},
{
"X": 40.0,
"Y": 10.0
}
],
"XScale": 1.0,
"YScale": 1.0
},
{
"Type": "CustomContainerInstance",
"Name": "customContainerStatusbar1",
"Y": -1,
"Width": 240,
"Height": 320,
"CustomContainerDefinitionName": "CustomContainerStatusbar"
}
],

 

Best answer by JohanAstrup

Hello @awiernie.

Just a quick follow-up to let you know that the bug has been fixed in TouchGFX 4.26.1.

Best regards,
Johan

2 replies

ST Employee
October 16, 2025

Hello @awiernie ,

When you post code into the forum please consider putting code blocks with :

LouisB_0-1760604879644.png

It helps readability.

Thanks for your bug report, after some experiment its caused when you have points defined with the same value.
I will discuss about it with the team.

BR,

awiernie
awiernieAuthor
Associate III
October 17, 2025

The shapes are triangles. Two of them hat the 4th point set equal to the 1st. The other two had accidently set the last point like the point before the last. 

I removed the 4th point from all of them which works.

But anyway it should be allowed to close the shape.

 

 

JohanAstrupBest answer
ST Employee
April 22, 2026

Hello @awiernie.

Just a quick follow-up to let you know that the bug has been fixed in TouchGFX 4.26.1.

Best regards,
Johan