(reply didn't go to list as I expected, grr..)
Naw, it should still work normally. I've done aligned & rotated text under
windows before with DrawTextW, you still pass the rect like you would if it wasn't rotated and set the alignment flags. The world transform should take care of getting it all rotated to where it is supposed to be with the alignments in the right place.
Maybe, but builtin gdiplus has its own world transform and doesn't use the gdi32 one. That's what transform_and_round_points is for.
True but you're still using the GDI32 DrawText to actually render the text. transform_and_round_points is only doing what it says, transforming the coordinates. If you rotate the text by 90 degrees, DrawText is still going to have to be aware that the text is to be rotated 90 degrees to draw it correctly or else you'll get your text at the right position, but the text direction will be wrong. Unless I'm overlooking something?
Ok question then, how do I separate this into two patches? Never done
anything with patches like this before so this is a first for me.
Just make two commits in Git, and format-patch will create two patch files.
That makes sense but, one question there. Does this mean I'm going to have to restore the file to it's original state, then add the one change, commit, add the other change, then commit again? With a change of this size, that isn't that big a deal. But on larger changes I could see that being a bit problematic. But maybe I'm just not used to it. =)
Thanks,
Stephan
Stephan Rose wrote:
Just make two commits in Git, and format-patch will create two patch files.
That makes sense but, one question there. Does this mean I'm going to have to restore the file to it's original state, then add the one change, commit, add the other change, then commit again? With a change
Not at all. # Reset the current branch one patch back. That will remove the commit # but keep the changes/diffs. git reset HEAD^ # Add changes (patch chunks) you want in the first patch git add -p . # Commit the first patch. git commit # Commit the rest aka the second patch. git commit .
If you don't feel confident with git it is probably a good idea to "backup" your current branch git branch master-20090602
of this size, that isn't that big a deal. But on larger changes I could see that being a bit problematic. But maybe I'm just not used to it. =)
bye michael
Maybe, but builtin gdiplus has its own world transform and doesn't use the gdi32 one. That's what transform_and_round_points is for.
True but you're still using the GDI32 DrawText to actually render the text. transform_and_round_points is only doing what it says, transforming the coordinates. If you rotate the text by 90 degrees, DrawText is still going to have to be aware that the text is to be rotated 90 degrees to draw it correctly or else you'll get your text at the right position, but the text direction will be wrong. Unless I'm overlooking something?
I don't really understand how this works, but it looks to me like GdipDrawString is using the world transform to decide on an angle and altering the font based on the angle, then sending the upper-left corner to DrawTextW. That's theoretically enough information for left alignment, but I'm not sure whether it works properly. For centered text, you also give it the X coordinate of the upper-right corner, but with text rotated 90 degrees this will be the same as the X coordinate of the upper-left corner.
Ok question then, how do I separate this into two patches? Never done
anything with patches like this before so this is a first for me.
Just make two commits in Git, and format-patch will create two patch files.
That makes sense but, one question there. Does this mean I'm going to have to restore the file to it's original state, then add the one change, commit, add the other change, then commit again? With a change of this size, that isn't that big a deal. But on larger changes I could see that being a bit problematic. But maybe I'm just not used to it. =)
In this case, yes, it'll probably be easiest if you do it that way.
In general, there are tools you can use to make it easier: * You can use git commit with the -a switch to modify the last commit. * git rebase -i origin/master will give you a list of the new commits, which it would normally apply in sequence on top of origin/master. You can then edit the list, having it apply the commits in a different order or stop at certain times in the process to let you add or modify commits. * git reset will move your current branch without changing your working directory. You can then redo commit(s) differently. * git add -p will let you interactively stage some changes but not others. I don't think this will make things much easier for you because you have one hunk that's involved in both horizontal and vertical alignment.
Git will keep anything you commit for at least 30 days, so a backup branch isn't strictly necessary. You can use the reflog command to find the id's of old commits.
- You can use git commit with the -a switch to modify the last commit.
Whoops, I meant --amend. -a is something else.