Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3b950a3

Browse files
temporary fix CLI app svg export (daisy_sewquence_cli), lifeline size zero.
1 parent7f5e938 commit3b950a3

File tree

1 file changed

+23
-11
lines changed

1 file changed

+23
-11
lines changed

‎daisy_sequence/js/renderer.js

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -423,15 +423,27 @@ module.exports.Renderer = class Renderer{
423423
constoffset=[12,10];
424424

425425
letb=text.bbox();
426-
letbox={
427-
'x':b.x-padding,
428-
'y':b.y-padding,
429-
'width':b.width+(padding*2)+offset[0],
430-
'height':b.height+offset[1],
431-
};
432-
lifeline_group.rect(box.width,box.height).move(box.x,box.y)
433-
.attr(attr).radius(radius);
434-
426+
letbox={};
427+
if(Number.isNaN(b.x)){
428+
// CLI用アプリによるsvg exportの際に、text.bbox()メンバの数値がすべてNaNになってしまうため、画像生成用のフォールバック
429+
box={
430+
'x':lifeline.x-1,
431+
'y':lifeline.y+4,
432+
'width':1,
433+
'height':24,
434+
}
435+
lifeline_group.rect(box.width,box.height).move(box.x,box.y)
436+
.attr(attr).radius(radius);
437+
}else{
438+
box={
439+
'x':b.x-padding,
440+
'y':b.y-padding,
441+
'width':b.width+(padding*2)+offset[0],
442+
'height':b.height+offset[1],
443+
};
444+
lifeline_group.rect(box.width,box.height).move(box.x,box.y)
445+
.attr(attr).radius(radius);
446+
}
435447
if(!lifeline.hasOwnProperty('work')){
436448
lifeline.work={};
437449
}
@@ -442,8 +454,8 @@ module.exports.Renderer = class Renderer{
442454

443455
letline_point={
444456
// 'x': box.x + (box.width / 2),
445-
'x':b.x,
446-
'y':box.y+(box.height),
457+
'x':lifeline.x,
458+
'y':box.y+(box.height)+3,
447459
};
448460
lety_end;
449461
if(null===stop_message){

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp