Try make «fixed» strokeWidth on scaling

时间:2016-06-06 14:17:32

标签: fabricjs

Find some solution of «scaling strokeWidth problem» in jsfiddle, but it have some strange reposition effect

<!DOCTYPE html>
<html lang="en">

<head>
  <meta name="generator" content="HTML Tidy for HTML5 (experimental) for Windows https://github.com/w3c/tidy-html5/tree/c63cc39" />
  <meta charset="utf-8" />
  <title>Test</title>
  <link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css" />
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
</head>
<body>
  <nav class="navbar navbar-inverse navbar-fixed-top">
    <div class="container">
      <div class="navbar-header">
        <a class="navbar-brand">Test</a>
      </div>
      <div id="navbar" class="navbar-collapse collapse">
          <form action="/logoutadmin" class="navbar-form navbar-right">
            <button class="btn btn-success" type="submit" id="user" onsubmit="return false">Log Out</button>
          </form>
      </div>
    </div>
  </nav>
  <div class="container-fluid">
    <button type="button" class="btn btn-primary btn-xs" data-toggle="offcanvas">Toggle nav</button>
    <div class="row row-offcanvas row-offcanvas-left">
      <div class="col-xs-6 col-sm-2 sidebar-offcanvas" id="sidebar" role="navigation">
        <div class="side-contain">
          <div class="panel-heading head" role="tab" id="headingOne">
            <h2 class="panel-title">My Account</h2>
          </div>
          <div class="btn-group">
            <button class="btn btn-default" type="button">Dropdown</button>
            <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
              <span class="caret"></span>
              <span class="sr-only">Toggle Dropdown</span>
            </button>
            <ul class="dropdown-menu">
              <li><a href="#">HTML</a>
              </li>
              <li><a href="#">CSS</a>
              </li>
              <li><a href="#">JavaScript</a>
              </li>
            </ul>
          </div>
          <a href="#" class="list-group-item btn">- Placeholder</a>
          <a href="#" class="list-group-item btn">- Placeholder</a>
          <a href="#" class="list-group-item btn">- Placeholder</a>
          <a href="#" class="list-group-item btn">- Placeholder</a>
        </div>
      </div>
      <!--/span-->
      <div class="col-xs-12 col-sm-10 content">
        <div>
          <h1 class="main-head">Test</h1>
          <p class="lead">Hallo
        </div>
      </div>
      <!--/span-->
    </div>
    <!--/row-->
  </div>
  <!-- /.container -->
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous">
  </script>
  <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
</body>
</html>

anyway I think about draw rect like path and redraw on scaling. Any goof idea?

0 个答案:

没有答案