authorly / interapptive-web

Authorly web-based storybook builder
1 stars 1 forks source link

Drag-N-Drop Image Resizing #904

Open whitman opened 11 years ago

whitman commented 11 years ago

Currently, image resizing is achieved via text fields. We'd like to keep this method of resizing but also include drag-n-drop resizing with edges/corners being the control areas.

image-resize-mockup

A & E

C & G

B, D, F & H

K & I

L & J

For reference: http://www.html5canvastutorials.com/labs/html5-canvas-drag-and-drop-resize-and-invert-images/

Features

A. ew-resize B. nwse-resize C. ns-resize D. nesw-resize E. ew-resize F. nwse-resize G. ns-resize H. nesw-resize

whitman commented 11 years ago

Updated the spec a bit @dira

dira commented 11 years ago

@whitman something else besides cursors?

dira commented 11 years ago

@whitman We need to change the structure of the json to accomodate different vertical/horizontal scaling. Right now it is

"CCScaleTo": [
      {
        "intensity": 1.1,
        "duration": 3,
        "actionTag": 22
      }
    ],

I propose

"CCScaleTo": [
      {
        "horizontal": 1.1,
        "vertical": 2.2,
        "duration": 3,
        "actionTag": 4
      }
    ],
whitman commented 11 years ago

Opened https://github.com/curiousminds/interapptive/issues/269 for this. We should be sure that the JSON has been updated in mobile before deploying/merging this

whitman commented 11 years ago

@dira I think we should use scaleX and scaleY instead of horizontal and vertical in the JSON since Cocos2d-x API uses scaleX (sx)and scaleY (sy) as the parameter names: http://www.cocos2d-x.org/reference/native-cpp/V3.0alpha0/d6/d06/classcocos2d_1_1_scale_to.html

Is that okay?

dira commented 11 years ago

@whitman

"CCScaleTo": [
  {
    "sx": 1.1,
    "sy": 2.2,
    "duration": 3,
    "actionTag": 4
  }
],
whitman commented 11 years ago

@dira Just the cursors and added expected behavior for the rest of the reference points (I, J, K, L). Please let me know if there should be more detail in some area and I'll try to be more precise/descriptive.

whitman commented 11 years ago

sx and sy sound good to me. Will proceed accordingly.

dira commented 11 years ago

The home button and the main menu buttons have an entry such as:

scale: {
  sx: 50
  sy: 200
}

As for the actions, they have the above structure:

"CCScaleTo": [
  {
    "sx": 110,
    "sy": 220,
    "duration": 3,
    "actionTag": 4
  }
]

sx and sy are positive integers, and signify the percentage to which the image is scaled to.

whitman commented 11 years ago

:thumbsup: