Skip to content
This repository has been archived by the owner on Mar 2, 2018. It is now read-only.

Buggy diagram width/height #31

Open
akfish opened this issue Mar 17, 2014 · 4 comments
Open

Buggy diagram width/height #31

akfish opened this issue Mar 17, 2014 · 4 comments

Comments

@akfish
Copy link

akfish commented Mar 17, 2014

Test Setup

Bugs described in this issue are usually hard to notice. I stumped upon them when using style:

// This code is in Less
.box-shadow (@color: #000, @x: 0, @y: 0, @blur: 1px, @spread, @secondary...) {
  -moz-box-shadow: @color @x @y @blur @spread, @secondary;
  -webkit-box-shadow: @color @x @y @blur @spread, @secondary;
  box-shadow: @color @x @y @blur @spread, @secondary;
}

.diagram {
     background-color: white;
     margin: 10px;
     padding: 10px;
     .box-shadow(rgba(0, 0, 0, 0.2), 0, 0, 0, 1px, rgba(0, 0, 0, 0.45), 0, 3px, 10px);
}

All tests are done in Chrome 33

Case 1 - Problem with padding

This happens with robustness diagram.

Code:

@actor "User" :-> @view "Browser"
@view "Browser" :-> @controller "Server"
@controller "Server" :-> @entity "Database"

Result when padding: 10px

image

The behavior is inconsistent in different cases:

  • padding-top = padding-bottom = 10px

image

  • padding-top (= 5px) < padding-bottom (= 10px)
    image
  • padding-top (= 10px) > padding-bottom (= 5px)
    image
  • No padding (for reference)
    image

Case 2 - Problem with shadows

No padding:

image

As you can see, sequence diagram and robustness diagram have different behaviors. The former one didn't take account of shadows when calculating width.

Case 3 - Problem with custom styling

Code:

@found "Browser", ->
  @alt {
    "[200]": -> @message "GET href resources", "HTTP Server"
    "[301]": -> @ref "GET the moved page"
    "[404]": -> @ref "show NOT FOUND"
  }
@find(".ref").css(width:256, "padding-bottom":4)
  .find(".tag").css float:"left"
get_the_moved_page.css "background-color":"#80c080"
show_not_found.css "background-color":"#f0b0b0"

No padding:

image

It looks like that the size is calculated before custom styling is done.

image

@tmtk75
Copy link
Owner

tmtk75 commented Apr 8, 2014

Hello, thanks for your report and I'm very very sorry for late reply. I've not realized this ticket so far.

I've seen some of these issues and I'd like to fix them, but unfortunately I don't have a time to improve because I'm busy on my daily biz... It would be thankful for me if you are waiting for fix patiently.

Thanks!

@akfish
Copy link
Author

akfish commented Apr 9, 2014

No problem. I can live with those tiny glitches. :)

tmtk75 added a commit that referenced this issue Jan 22, 2015
@togume
Copy link

togume commented Mar 18, 2015

@akfish - this is awesome bug reporting! I'd vote to split them up into their own individual issues so they can be tackled independently/prioritized.

@tmtk75
Copy link
Owner

tmtk75 commented Jul 28, 2015

JFYI: I think case 2 & case 3 were fixed by 6d6e17c or other commits.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants