<commit_before>window.onload = function() {
  'use strict';

  // create a scene
  var scn = new DivSugar.Scene().setSize(800, 600).setImage('#004000').appendTo(document.body);

  // maximize the scene size
  window.onresize = function() { scn.adjustLayout(window.innerWidth, window.innerHeight, 'contain'); };
  window.onresize();

  //
  // create a parent node used as the center of rotation
  var node1 = new DivSugar.Node().setPosition(400, 300, 0).appendTo(scn);

  // create a child node which renders an image and a text
  var node2 = new DivSugar.Node().setSize(300, 300).setPosition(-150, -150, 0).setImage('../assets/kitten.jpg').appendTo(node1);

  // TBD
  var task = new DivSugar.Task().appendTo(DivSugar.rootTask);
  var curX, curY, lastX, lastY, rotX, rotY;
  var pos = new DivSugar.Vector();
  var mat = new DivSugar.Matrix();
  var origin = new DivSugar.Matrix();

  task.onUpdate = function() {
    if (DivSugar.getMouseState('pressed')) {
      lastX = DivSugar.getMouseX();
      lastY = DivSugar.getMouseY();
    }

    if (DivSugar.getMouseState('on')) {
      curX = DivSugar.getMouseX();
      curY = DivSugar.getMouseY();

      rotX = -(curY - lastY) * this.deltaTime * 0.04;
      rotY = (curX - lastX) * this.deltaTime * 0.04;

      node1.getPosition(pos);
      node1.getTransform(mat);

      origin.set(DivSugar.Matrix.UNIT);
      origin.rotate(rotX, rotY, 0);
      mat.toGlobal_noTrans(origin);

      mat.trans.set(pos);

      node1.setTransform(mat);

      lastX = curX;
      lastY = curY;
    }

    if (DivSugar.getMouseState('released')) {
    }
  };
};<commit_msg>Implementing<commit_after>window.onload = function() {
  'use strict';

  // create a scene
  var scn = new DivSugar.Scene().setSize(800, 600).setImage('#004000').appendTo(document.body);

  // maximize the scene size
  window.onresize = function() { scn.adjustLayout(window.innerWidth, window.innerHeight, 'contain'); };
  window.onresize();

  //
  // create a parent node used as the center of rotation
  var node1 = new DivSugar.Node().setPosition(400, 300, 0).appendTo(scn);

  // create a child node which renders an image and a text
  var node2 = new DivSugar.Node().setSize(300, 300).setPosition(-150, -150, 0).setImage('../assets/kitten.jpg').appendTo(node1);

  // TBD
  var task = new DivSugar.Task().appendTo(DivSugar.rootTask);
  var curX, curY, lastX, lastY, rotX, rotY;
  var pos = new DivSugar.Vector();
  var mat = new DivSugar.Matrix();
  var origin = new DivSugar.Matrix();

  var vec = new DivSugar.Vector();

  task.onUpdate = function() {
    if (DivSugar.getMouseState('pressed')) {
      lastX = DivSugar.getMouseX();
      lastY = DivSugar.getMouseY();
    }

    if (DivSugar.getMouseState('on')) {
      curX = DivSugar.getMouseX();
      curY = DivSugar.getMouseY();

      rotX = -(curY - lastY) * this.deltaTime * 0.04;
      rotY = (curX - lastX) * this.deltaTime * 0.04;

      node1.getPosition(pos);
      node1.getTransform(mat);

      origin.set(DivSugar.Matrix.UNIT);
      origin.rotate(rotX, rotY, 0);
      mat.toGlobal_noTrans(origin);

      mat.trans.set(pos);

      node1.setTransform(mat);

      lastX = curX;
      lastY = curY;

      scn.getLocalPosition(curX, curY, vec);
    }

    if (DivSugar.getMouseState('released')) {
    }
  };
};
{'fraction_non_alphanumeric': 0.15307668990603213, 'fraction_numerical': 0.027280994240678993, 'mean_word_length': 3.0690505548705302, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '111912', 'n_tokens_mistral': 1241, 'n_tokens_neox': 1143, 'n_words': 245}