Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(82)

Side by Side Diff: third_party/WebKit/Source/core/layout/ng/geometry/ng_static_position.cc

Issue 2721613003: [LayoutNG] Move remaining ng_units structs to their own files (Closed)
Patch Set: Don't export NGBoxStrut for now Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "core/layout/ng/geometry/ng_static_position.h"
6
7 namespace blink {
8
9 NGStaticPosition NGStaticPosition::Create(NGWritingMode writing_mode,
10 TextDirection direction,
11 NGPhysicalOffset offset) {
12 NGStaticPosition position;
13 position.offset = offset;
14 switch (writing_mode) {
15 case kHorizontalTopBottom:
16 position.type = (direction == TextDirection::kLtr) ? kTopLeft : kTopRight;
17 break;
18 case kVerticalRightLeft:
19 case kSidewaysRightLeft:
20 position.type =
21 (direction == TextDirection::kLtr) ? kTopRight : kBottomRight;
22 break;
23 case kVerticalLeftRight:
24 position.type =
25 (direction == TextDirection::kLtr) ? kTopLeft : kBottomLeft;
26 break;
27 case kSidewaysLeftRight:
28 position.type =
29 (direction == TextDirection::kLtr) ? kBottomLeft : kTopLeft;
30 break;
31 }
32 return position;
33 }
34
35 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698