New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement asymmetric border colors #689
Merged
+39
−23
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.
Implement asymmetric border colors
- Loading branch information
commit 0e863b3cef679738767267b3e61ef28511daaddb
| @@ -639,7 +639,11 @@ impl RenderBox { | ||
| extra: ExtraDisplayListData::new(*self), | ||
| }, | ||
| border: debug_border, | ||
| color: rgb(0, 0, 200).to_gfx_color(), | ||
| color: SideOffsets2D::new(rgb(0, 0, 200).to_gfx_color(), | ||
sammykim
Author
Contributor
|
||
| rgb(0, 0, 200).to_gfx_color(), | ||
| rgb(0, 0, 200).to_gfx_color(), | ||
| rgb(0, 0, 200).to_gfx_color()) | ||
|
|
||
| }; | ||
| list.append_item(BorderDisplayItemClass(border_display_item)) | ||
| } | ||
| @@ -659,7 +663,11 @@ impl RenderBox { | ||
| extra: ExtraDisplayListData::new(*self), | ||
| }, | ||
| border: debug_border, | ||
| color: rgb(0, 200, 0).to_gfx_color(), | ||
| color: SideOffsets2D::new(rgb(0, 200, 0).to_gfx_color(), | ||
| rgb(0, 200, 0).to_gfx_color(), | ||
| rgb(0, 200, 0).to_gfx_color(), | ||
| rgb(0, 200, 0).to_gfx_color()) | ||
|
|
||
| }; | ||
| list.append_item(BorderDisplayItemClass(border_display_item)) | ||
| } | ||
| @@ -687,7 +695,11 @@ impl RenderBox { | ||
| extra: ExtraDisplayListData::new(*self), | ||
| }, | ||
| border: debug_border, | ||
| color: rgb(0, 0, 200).to_gfx_color(), | ||
| color: SideOffsets2D::new(rgb(0, 0, 200).to_gfx_color(), | ||
| rgb(0, 0, 200).to_gfx_color(), | ||
| rgb(0, 0, 200).to_gfx_color(), | ||
| rgb(0, 0, 200).to_gfx_color()) | ||
|
|
||
| }; | ||
| list.append_item(BorderDisplayItemClass(border_display_item)) | ||
| } | ||
| @@ -914,9 +926,10 @@ impl RenderBox { | ||
| return | ||
| } | ||
|
|
||
| // FIXME: all colors set to top color. this is obviously not right. | ||
| let top_color = self.style().border_top_color(); | ||
| let color = top_color.to_gfx_color(); | ||
| let right_color = self.style().border_right_color(); | ||
| let bottom_color = self.style().border_bottom_color(); | ||
| let left_color = self.style().border_left_color(); | ||
|
|
||
| // Append the border to the display list. | ||
| do list.with_mut_ref |list| { | ||
| @@ -929,7 +942,10 @@ impl RenderBox { | ||
| border.right, | ||
| border.bottom, | ||
| border.left), | ||
| color: color, | ||
| color: SideOffsets2D::new(top_color.to_gfx_color(), | ||
| right_color.to_gfx_color(), | ||
| bottom_color.to_gfx_color(), | ||
| left_color.to_gfx_color()) | ||
| }; | ||
|
|
||
| list.append_item(BorderDisplayItemClass(border_display_item)) | ||
ProTip!
Use n and p to navigate between commits in a pull request.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
I think you want
debug_colorlocal variable just likedebug_border.