Migrate from 1.4
This page lists the key points to pay attention to when migrating existing code from iink SDK 1.4 to the new iink SDK 1.5.
You are recommended to use the latest recognition resource packs to benefit from the latest improvements made to MyScript technology.
API updates
IEditorListener refactoring
To improve error management, the method onError
has been modified to include a new argument that gives the error code corresponding to the Editor error.
In addition, new ink gestures errors have been added.
➤ In Objective-C: you should modify your IEditorListener
implementation if you want to use this new parameter into the onError
method.
➤ In java and C#, for the sake of clarity, we have decided to take advantage of this update to merge the legacy IEditorListener
and IEditorListener2
interfaces into a single one. So, you should modify your implementation to add this new parameter into the onError
signature, and refactor your code to use the new IEditorListener
. If you were using IEditorListener
, this means adding the selectionChanged
and activeBlockChanged
methods coming from IEditorListener2
. If you were implementing IEditorListener2
, you should update the interface name and your imports to use IEditorListener
.
JIIX format evolution
Version incremented from 2 to 3
The JIIX format has been updated to version 3. This allowed the inclusion of new information. If you were parsing JIIX output, you will have to update your parser code to follow the (small) evolutions that came with this new version.
Key changes
- The
character
object now includes acandidates
array that contains the list of recognition candidates associated with this character. - The
label
property of diagram item of typeNode
has been renamedlabel-element
. -
For raw content and diagram item blocks, the
id
value has evolved with the addition of a prefix identifying their parents. - For drawing blocks containing images, an
image
object has been added. - For text blocks, a new object
structure
is available with theexport.jiix.text.structure
configuration. - By default, the
linebreaks
object is no more present. If you want to have information about the line breaks, we recommend you using the newstructure
object. If you still want to use the deprecatedlinebreaks
object, you might though prefer to use theexport.jiix.deprecated.text.linebreaks
property instead.
➤ JIIX reference (updated to version 3)
Eraser settings
-
Eraser settings have changed for
"Text Document"
,"Raw Content"
and"Drawing"
:erase-precisely
replaceserase-entire-strokes
. -
The default behavior remains unchanged for
"Raw Content"
and"Drawing"
: by default theerase-precisely
is true, ie the eraser only erases ink portions within its trajectory. This corresponds to the previouserase-entire-strokes
false value. So if you were using the default values, you don’t have anything to do. But if you have customised theerase-entire-strokes
value, make sure to update your application with the newerase-precisely
setting. -
For
"Text Document"
, the behavior is now identical for all types of blocks: eraser precision default level is the object or groups of objects (stroke, character, …). Precision change applies to all blocks of a"Text Document"
with theerase-precisely
property. Thedrawing.erase-entire-strokes
has been withdrawn, so it is no more possible to have for example “stroke” precision on"Text"
blocks and “precise” precision on"Drawing"
blocks.
Shape recognition feedback
- By default the diagram shape recognition feedback is activated but there is no
.diagram-fill
styling class pen fill color. So if you want to keep the same blue background shape coloring as with previous version, you should set the following theme:
.diagram-fill{-myscript-pen-fill-color:#44AADF44;}
- With iink 1.4, the setting that was used for enabling the shape recognition feedback in a Raw Content part was
raw-content.feedback.fill-shape
which has been replaced by the new oneraw-content.recognition.feedback
. The latter proposes more options. By default, there is no feedback which was already the case with iink 1.4. So, if you had not modified this setting, you don’t have anything to do. But if you had enabled it, you should modify your code to use the new setting. For further details on how to do it, please refer to the configuration and styling pages.
Other changes
diagram.enable-sub-blocks property splitting
Up to the 1.4 version, the diagram.enable-sub-blocks
property was used to control whether sub blocks were accessible in either Diagram parts or Diagram or Raw Content blocks of Text Document parts.
In 1.5 we introduce a new property text-document.enable-sub-blocks
to control sub-block access for blocks within Text Document parts.
Thus, the diagram.enable-sub-blocks
property now only applies to Diagram parts. By default, both properties remain true
.
So, if you had disabled the diagram.enable-sub-blocks
property and are using Text Document parts, make sure to set the text-document.enable-sub-blocks
to false
.
Stroke text highlight styling change
The default styling -myscript-text-decoration-style applied when drawing a frame around some stroke text has changed. It used to be an outline frame around the text. In 1.5, it is a background color decoration that highlights the text. So, if you want to keep the same behavior as the 1.4 default one, you should set the following theme:
stroke.text-highlight{-myscript-text-decoration-style:framed-outline;}
In addition, in 1.4 the highlight color was the pen color with alpha except for some predefined colors like black that led to a yellow highlight. In 1.5 there is no more exception: the highlight color is always the pen color with alpha.
Undo/redo mode standardization
The undo/redo behavior has been standardized and is now based on strokes for all Content Types.