flex-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Harbs (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLEX-33693) TLF Lists which have ParagraphElements with hanging indents do not render correctly
Date Fri, 30 Aug 2013 08:15:52 GMT

    [ https://issues.apache.org/jira/browse/FLEX-33693?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13754485#comment-13754485
] 

Harbs commented on FLEX-33693:
------------------------------

Here is an application which displays the problem:

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
			   xmlns:s="library://ns.adobe.com/flex/spark" 
			   xmlns:mx="library://ns.adobe.com/flex/mx"
			   width="400" minWidth="955" minHeight="600" creationComplete="onComplete()">
	<fx:Script>
		<![CDATA[
			import flashx.textLayout.elements.ListElement;
			import flashx.textLayout.elements.ListItemElement;
			import flashx.textLayout.elements.ParagraphElement;
			import flashx.textLayout.elements.SpanElement;
			import flashx.textLayout.elements.TextFlow;
			import flashx.textLayout.formats.ListMarkerFormat;
			import flashx.textLayout.formats.ListStylePosition;
			import flashx.textLayout.formats.ListStyleType;
			[Bindable]private var textFlow:TextFlow;
			
			private function onComplete():void{
				var para:ParagraphElement;
				var span:SpanElement;
				
				textFlow =  new TextFlow();
				textFlow.tabStops = "s12 s72";
				para = new ParagraphElement();
				span = new SpanElement();
				span.fontSize = 16;
				span.fontWeight = "bold";
				span.text = "List paragraphs:";
				para.addChild(span);
				textFlow.addChild(para);
				var list:ListElement = new ListElement();
				list.listAutoPadding = 0;
				for(var i:int=0;i<2;i++){
					para = new ParagraphElement();
					para.textIndent = -12;
					para.paragraphStartIndent = 12;
					span = new SpanElement();
					span.text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ultricies
id nisl sit amet sollicitudin. Integer vehicula justo ac lorem tincidunt varius. Quisque egestas
felis turpis, porttitor tempus ligula tempor ac. Etiam facilisis neque et imperdiet tristique.
Integer non tortor congue, lobortis dui sed, ultrices metus. Curabitur sodales, risus non
ornare pulvinar, nunc enim pharetra justo, interdum blandit nibh quam vel leo. Suspendisse
id ante nec est eleifend sollicitudin. Maecenas orci tortor, tempus vitae odio sit amet, ultrices
eleifend lacus.";
					para.addChild(span);
					var item:ListItemElement = 	new ListItemElement();
					item.listStylePosition = ListStylePosition.INSIDE;
					item.listStyleType = ListStyleType.DISC;
					var marker:ListMarkerFormat = new ListMarkerFormat();
					marker.afterContent = "\t";
					item.listMarkerFormat = marker;
					item.addChild(para);
					list.addChild(item);
				}
				textFlow.addChild(list);
				para = new ParagraphElement();
				span = new SpanElement();
				span.fontSize = 16;
				span.fontWeight = "bold";
				span.text = "Non-list paragraphs:";
				para.addChild(span);
				textFlow.addChild(para);

				for(i=0;i<2;i++){
					para = new ParagraphElement();
					para.textIndent = -12;
					para.paragraphStartIndent = 12;
					span = new SpanElement();
					span.text = "*\tLorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ultricies
id nisl sit amet sollicitudin. Integer vehicula justo ac lorem tincidunt varius. Quisque egestas
felis turpis, porttitor tempus ligula tempor ac. Etiam facilisis neque et imperdiet tristique.
Integer non tortor congue, lobortis dui sed, ultrices metus. Curabitur sodales, risus non
ornare pulvinar, nunc enim pharetra justo, interdum blandit nibh quam vel leo. Suspendisse
id ante nec est eleifend sollicitudin. Maecenas orci tortor, tempus vitae odio sit amet, ultrices
eleifend lacus.";
					para.addChild(span);
					textFlow.addChild(para);
				}
				para = new ParagraphElement();
				span = new SpanElement();
				span.fontSize = 16;
				span.fontWeight = "bold";
				span.text = "List with adjusted tabs:";
				para.addChild(span);
				textFlow.addChild(para);
				list = new ListElement();
				list.listAutoPadding = 0;
				for(i=0;i<2;i++){
					para = new ParagraphElement();
					para.textIndent = -12;
					para.paragraphStartIndent = 12;
					para.tabStops = "s12 s24";
					span = new SpanElement();
					span.text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ultricies
id nisl sit amet sollicitudin. Integer vehicula justo ac lorem tincidunt varius. Quisque egestas
felis turpis, porttitor tempus ligula tempor ac. Etiam facilisis neque et imperdiet tristique.
Integer non tortor congue, lobortis dui sed, ultrices metus. Curabitur sodales, risus non
ornare pulvinar, nunc enim pharetra justo, interdum blandit nibh quam vel leo. Suspendisse
id ante nec est eleifend sollicitudin. Maecenas orci tortor, tempus vitae odio sit amet, ultrices
eleifend lacus.";
					para.addChild(span);
					item = 	new ListItemElement();
					item.listStylePosition = ListStylePosition.INSIDE;
					item.listStyleType = ListStyleType.DISC;
					marker = new ListMarkerFormat();
					marker.afterContent = "\t";
					item.listMarkerFormat = marker;
					item.addChild(para);
					list.addChild(item);
				}
				textFlow.addChild(list);
			}
		]]>
	</fx:Script>
	<s:RichEditableText verticalCenter="0" width="400" textFlow="{textFlow}"/>
</s:Application>
                
> TLF Lists which have ParagraphElements with hanging indents do not render correctly
> -----------------------------------------------------------------------------------
>
>                 Key: FLEX-33693
>                 URL: https://issues.apache.org/jira/browse/FLEX-33693
>             Project: Apache Flex
>          Issue Type: Bug
>    Affects Versions: Apache Flex 4.10.0
>            Reporter: Harbs
>
> A hanging indent is defined by setting the paragraphStartIndent to a positive number
and the textIndent to an inverse negative number. This work correctly as long as you specify
a tab stop at the position of the paragraphStartIndent. (I don't know if this desired behavior
or not.)
> If the paragraph is in a ListItemElement, the text is not tabbed to the position of the
paragraphStartIndent. It seems the textIndent value is subtracted for the calculated tab location
of the entire line. The text is instead tabbed to the next tab position.
> Possible workaround:
> Specifying a tab position at double the paragraphStartIndent causes the text to look
correct, but only because the text is shifted to the left the amount of the textIndent.
> Below, I will attach a sample application which illustrates these points.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message