Skip to content

Commit 6034bf1

Browse files
Use drawPorts for gather's port labels. For #1745.
1 parent 3f130ed commit 6034bf1

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

model/operation.cc

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1237,15 +1237,13 @@ namespace minsky
12371237
template <> void Operation<OperationType::gather>::iconDraw(cairo_t* cairo) const
12381238
{
12391239
const double sf = scaleFactor();
1240-
cairo_scale(cairo,sf,sf);
1240+
cairo_scale(cairo,sf,sf);
12411241
cairo_set_font_size(cairo,8);
12421242
cairo_move_to(cairo,-7,3);
12431243
cairo_show_text(cairo,"x[i]");
1244-
cairo_set_font_size(cairo,5);
1245-
cairo_move_to(cairo, l+1, -h+6);
1246-
cairo_show_text(cairo,"x");
1247-
cairo_move_to(cairo, l+1, h-3);
1248-
cairo_show_text(cairo,"i");
1244+
DrawBinOp drawBinOp(cairo);
1245+
drawBinOp.drawPort([&](){drawBinOp.drawSymbol("x");},l,-h,rotation());
1246+
drawBinOp.drawPort([&](){drawBinOp.drawSymbol("i");},l,h,rotation());
12491247
}
12501248

12511249
template <> void Operation<OperationType::meld>::iconDraw(cairo_t* cairo) const

0 commit comments

Comments
 (0)