Cloud Development Kit

How to offset the myscript-common-element

I'm trying to use myscript-math-web. I cannot work out how to place the myscript-common-element offset on the screen and get the pen to write where I've got the cursor. It seems to always offset the ink by the distance from the left of the screen.


Dear Henry,

Thanks for your bug report, we hope to fix this issue in the next release, we will keep you updated.
However, it should be possible to find a workaround. To do so, we need to have a look at your code and webpage. Is it available on GitHub?

Best regards

I don't have it on github but all I've done is make a slight modification to myscript-math-web.html as below:

<template>
<div class="container">
<div class="row">
<div class="col-sm-2 text-right">1+1=</div>
<div class="col-sm-2" id="resultField" hidden="[[hideresult]]"></div>
    <div class="col-sm-8">
     <div class="horizontal layout buttons" hidden="[[hidebuttons]]">
      <paper-fab class="delete" mini icon="delete" title="delete" on-tap="delete"></paper-fab>
      <paper-fab class="undo" mini icon="undo" title="undo" on-tap="undo" disabled="{{ !canundo }}"></paper-fab>
      <paper-fab class="redo" mini icon="redo" title="redo" on-tap="redo" disabled="{{ !canredo }}"></paper-fab>
     </div>
   
     <myscript-common-element host="{{ host }}"
            protocol="{{ protocol }}"
            type="MATH"
            resulttypes="{{ resulttypes }}"
            applicationkey="{{ applicationkey }}"
            hmackey="{{ hmackey }}"
            timeout="{{ timeout }}"
            on-changed="_onChanged"
            on-success="_onSuccess"
            on-failure="_onFailure">
     </myscript-common-element>
     
     <paper-toast class="error"></paper-toast>
    </div>
   </div>
  </div>
  
<a class="btn btn-sm btn-primary" href="javascript:copy_result()">Submit</a>
<input type="text" readonly id="myResult" hidden />

</template>

Login or Signup to post a comment