Skip to content

Commit

Permalink
Traktor: Fixed some graph control shapes.
Browse files Browse the repository at this point in the history
  • Loading branch information
apistol78 committed May 1, 2024
1 parent fdace59 commit 56304b7
Show file tree
Hide file tree
Showing 7 changed files with 351 additions and 213 deletions.
11 changes: 7 additions & 4 deletions code/Ui/Graph/InOutNodeShape.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,16 @@ void InOutNodeShape::paint(GraphControl* graph, const Node* node, GraphCanvas* c

const int32_t tw = sz.cx / 3;

const int32_t dw = rc.getWidth() - dim.marginWidth * 2;
const int32_t dh = rc.getHeight();

const int32_t sx[] = { 0, tw, sz.cx - tw, sz.cx };
const int32_t dx[] = { 0, tw, rc.getWidth() - tw, rc.getWidth() };
const int32_t dx[] = { 0, tw, dw - tw, dw };

for (int32_t ix = 0; ix < 3; ++ix)
{
canvas->drawBitmap(
rc.getTopLeft() + Size(dx[ix], 0),
rc.getTopLeft() + Size(dim.marginWidth, 0) + Size(dx[ix], 0),
Size(dx[ix + 1] - dx[ix], sz.cy),
Point(sx[ix], 0),
Size(sx[ix + 1] - sx[ix], sz.cy),
Expand All @@ -152,7 +155,7 @@ void InOutNodeShape::paint(GraphControl* graph, const Node* node, GraphCanvas* c
canvas->setBackground(Color4ub(255, 255, 255));

const Point inputPinPos(
rc.left - pinSize.cx / 2 + dim.marginWidth,
rc.left,
rc.getCenter().y - pinSize.cy / 2
);

Expand All @@ -166,7 +169,7 @@ void InOutNodeShape::paint(GraphControl* graph, const Node* node, GraphCanvas* c
);

const Point outputPinPos(
rc.right - pinSize.cx / 2 - dim.marginWidth,
rc.right - pinSize.cx,
rc.getCenter().y - pinSize.cy / 2
);

Expand Down
6 changes: 3 additions & 3 deletions code/Ui/Graph/InputNodeShape.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ void InputNodeShape::paint(GraphControl* graph, const Node* node, GraphCanvas* c
const PaintSettings& settings = canvas->getPaintSettings();
const Dim dim(graph);

Rect rc = graph->pixel(node->calculateRect()).offset(offset);
const Rect rc = graph->pixel(node->calculateRect()).offset(offset);

// Draw node shape.
{
Expand Down Expand Up @@ -136,13 +136,13 @@ void InputNodeShape::paint(GraphControl* graph, const Node* node, GraphCanvas* c

canvas->setBackground(Color4ub(255, 255, 255));

const Point pos(
const Point outputPinPos(
rc.right - pinSize.cx,
rc.getCenter().y - pinSize.cy / 2
);

canvas->drawBitmap(
pos,
outputPinPos,
pinSize,
Point(0, 0),
pinSize,
Expand Down
4 changes: 2 additions & 2 deletions code/Ui/Graph/OutputNodeShape.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,13 @@ void OutputNodeShape::paint(GraphControl* graph, const Node* node, GraphCanvas*

canvas->setBackground(Color4ub(255, 255, 255));

const Point pos(
const Point inputPinPos(
rc.left,
rc.getCenter().y - pinSize.cy / 2
);

canvas->drawBitmap(
pos,
inputPinPos,
pinSize,
Point(0, 0),
pinSize,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,12 @@
<name>Main</name>
<inherit>{00000000-0000-0000-0000-000000000000}</inherit>
<layers>
<item type="traktor.runtime.WorldLayerData">
<name>world</name>
<permitTransition>true</permitTransition>
<scene>{646C7F9F-A386-A74E-9279-DD00117958A2}</scene>
</item>
<item type="traktor.spark.SparkLayerData" version="1">
<name>ui</name>
<permitTransition>true</permitTransition>
<movie>{E7EB59C5-57F9-BE42-93A3-FE38268D507D}</movie>
<externalMovies/>
<clearBackground>false</clearBackground>
<clearBackground>true</clearBackground>
<enableSound>true</enableSound>
</item>
</layers>
Expand Down
192 changes: 109 additions & 83 deletions resources/runtime/themes/Dark/New/UI/Graph/InOut.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 56304b7

Please sign in to comment.