When you click the left/right/center justify buttons it calls the execCommand method for the selected element and so moves all of the text (rather than just the selected line of text) as it's usually all in the same P element.
If you're using RichTextBox1.ReturnKeyBehavior = BreakMode.LineBreak; then you could implement the following so that it will only move the selected line of text.
Add an input button or new toolbar button with the following event and function call (to do a center justify) -
onclick="setAlignment('center')
The javascript function in your .aspx page -
<script type=text/javascript language=javascript>
function setAlignment(align)
{
var selectedText = RichTextBox1_x5.document.selection;
var newRange = selectedText.createRange();
var x = RichTextBox1_x5.document.body.innerHTML;
var newHtml = x.replace(new RegExp([newRange.text + '<BR>']),'<div align=' + align + '>' + newRange.text + '</div>');
RichTextBox1_x5.document.body.innerHTML = newHtml;
}
</script>
You should then find this is aligns on a selected line basis rather than all the lines when ReturnKeyBehavior = BreakMode.LineBreak; so that <BR> tags are inserted.
In this case the RichTextBox instance ID = RichTextBox1 so you’ll need to modify this (be sure to add the _x5 suffix which refers to the Editor/Iframe) if your ID is different.