feat: F4.8a the documentation items in model and file, measured against Java's
New oracle DocuRun on Java's JDocuElement. Italic is kept (the model knew only bold), an item keeps its file's size and font size (Swift's 32 x 24 and 8-72 changed Java's files), an item without a colour is Java's light grey. Java's new items, colour lists, font sizes and styles, the drag's smallest sizes and Java's stacking; document commands for the editor. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1282,18 +1282,28 @@ describe('importProject rules', () => {
|
||||
{ ...item, type: 2, color: null },
|
||||
{ ...item, type: 1, width: 0, color: [1, 2, 3, 255] },
|
||||
{ ...item, type: 3, color: [1, 2, 3, 255] },
|
||||
{ ...item, type: 1, text: null, color: null },
|
||||
{ ...item, type: 2, width: 15, height: 10, color: [1, 2, 3, 255], font: { name: 'Serif', style: 3, size: 6 } },
|
||||
{ ...item, type: 2, color: [1, 2, 3, 255], font: { name: 'Dialog', style: 2, size: 18 } },
|
||||
],
|
||||
}),
|
||||
counter(),
|
||||
);
|
||||
|
||||
expect(project.documentationItems.map((doc) => [doc.kind, doc.text, doc.color, doc.fontName, doc.fontSize])).toEqual([
|
||||
['text', 'Hallo', { red: 0, green: 0, blue: 0, alpha: 1 }, 'Dialog', 12],
|
||||
// Without a colour, light grey, as Java shows it (JDocuElement.setColor(null)), either kind; italic kept; a small size and font size kept.
|
||||
const grey = { red: 192 / 255, green: 192 / 255, blue: 192 / 255, alpha: 1 };
|
||||
const rgb = { red: 1 / 255, green: 2 / 255, blue: 3 / 255, alpha: 1 };
|
||||
expect(project.documentationItems.map((doc) => [doc.kind, doc.text, doc.color, doc.fontName, doc.fontSize, doc.isBold, doc.isItalic, doc.frame.width, doc.frame.height])).toEqual([
|
||||
['rectangle', '', grey, 'Dialog', 12, false, false, 100, 30],
|
||||
['text', 'Hallo', grey, 'Dialog', 12, false, false, 100, 30],
|
||||
['text', 'Hallo', rgb, 'Serif', 6, true, true, 15, 10],
|
||||
['text', 'Hallo', rgb, 'Dialog', 18, false, true, 100, 30],
|
||||
]);
|
||||
expect(project.warnings).toEqual([
|
||||
'documentation item 1 without a color, given the default',
|
||||
'documentation item without size, left out',
|
||||
'documentation item of type 3, left out (known: RECT = 1, TEXT = 2)',
|
||||
'documentation item 2 without a color, given the default',
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user